a bit of fixes

This commit is contained in:
MX 2022-08-06 05:18:05 +03:00
parent 903e6ec203
commit ffc3b634b8
No known key found for this signature in database
GPG key ID: 6C4C311DFD4B4AB5
2 changed files with 6 additions and 1 deletions

View file

@ -115,7 +115,7 @@ BadUsbApp* bad_usb_app_alloc(char* arg) {
void bad_usb_app_free(BadUsbApp* app) { void bad_usb_app_free(BadUsbApp* app) {
furi_assert(app); furi_assert(app);
if(app->bad_usb_script != NULL) { if(app->bad_usb_script) {
bad_usb_script_close(app->bad_usb_script); bad_usb_script_close(app->bad_usb_script);
app->bad_usb_script = NULL; app->bad_usb_script = NULL;
} }

View file

@ -905,6 +905,11 @@ bool subghz_protocol_decoder_keeloq_deserialize(void* context, FlipperFormat* fl
FURI_LOG_E(TAG, "Deserialize error"); FURI_LOG_E(TAG, "Deserialize error");
break; break;
} }
if(instance->generic.data_count_bit !=
subghz_protocol_keeloq_const.min_count_bit_for_found) {
FURI_LOG_E(TAG, "Wrong number of bits in key");
break;
}
if(!flipper_format_rewind(flipper_format)) { if(!flipper_format_rewind(flipper_format)) {
FURI_LOG_E(TAG, "Rewind error"); FURI_LOG_E(TAG, "Rewind error");
break; break;