From fad24efdf076725468e8793d6d3d592e768dcd2a Mon Sep 17 00:00:00 2001 From: Georgii Surkov <37121527+gsurkov@users.noreply.github.com> Date: Fri, 24 Mar 2023 03:26:43 +0300 Subject: [PATCH] [FL-3188] Fix crash when emulating a DSGeneric key (#2530) --- lib/ibutton/protocols/dallas/protocol_ds_generic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ibutton/protocols/dallas/protocol_ds_generic.c b/lib/ibutton/protocols/dallas/protocol_ds_generic.c index af355f461..6c698bb89 100644 --- a/lib/ibutton/protocols/dallas/protocol_ds_generic.c +++ b/lib/ibutton/protocols/dallas/protocol_ds_generic.c @@ -62,6 +62,7 @@ bool ds_generic_write_blank(OneWireHost* host, iButtonProtocolData* protocol_dat } static bool ds_generic_reset_callback(bool is_short, void* context) { + furi_assert(context); DallasGenericProtocolData* data = context; if(!is_short) { onewire_slave_set_overdrive(data->state.bus, is_short); @@ -93,7 +94,7 @@ void ds_generic_emulate(OneWireSlave* bus, iButtonProtocolData* protocol_data) { DallasGenericProtocolData* data = protocol_data; data->state.bus = bus; - onewire_slave_set_reset_callback(bus, ds_generic_reset_callback, NULL); + onewire_slave_set_reset_callback(bus, ds_generic_reset_callback, protocol_data); onewire_slave_set_command_callback(bus, ds_generic_command_callback, protocol_data); }