From 9bf8f1015d6b4bc03478cbc8ad9e761ab3cc0be4 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sun, 3 Dec 2023 18:41:28 +0300 Subject: [PATCH] fix keeloq null pointer if unknown --- lib/subghz/protocols/keeloq.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/subghz/protocols/keeloq.c b/lib/subghz/protocols/keeloq.c index 464f27ac5..700f1f6d0 100644 --- a/lib/subghz/protocols/keeloq.c +++ b/lib/subghz/protocols/keeloq.c @@ -979,6 +979,13 @@ static void subghz_protocol_keeloq_check_remote_controller( // If we are in BFT / Aprimatic programming mode we will set previous remembered counter and skip mf keys check ProgMode prog_mode = subghz_custom_btn_get_prog_mode(); if(prog_mode == PROG_MODE_OFF) { + if(keystore->mfname == 0x0) { + keystore->mfname = ""; + } + if(*manufacture_name == 0x0) { + *manufacture_name = ""; + } + // Case when we have no mf name means that we are checking for the first time and we have to check all conditions if((strlen(keystore->mfname) < 1) && strlen(*manufacture_name) < 1) { // Check key AN-Motors