[FL-2431, FL-2419] SubGhz: bugfixes (#1098)
* [FL-2431] SubGhz: fix Restart with an error (HardFault), while maintaining the RAW signal. * Stream: fix adding maximum string length to arguments * [FL-2419] SubGhz: fix flipper hang/Fatal Error when running edited Sub-GHz file. * SubGhz: remove replace strcpy with strncpy, smaller text buffer and canary * SubGhz: log key loading before load happen, rollback only rx message handling Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -296,6 +296,10 @@ void subghz_free(SubGhz* subghz) {
|
||||
furi_record_close("notification");
|
||||
subghz->notifications = NULL;
|
||||
|
||||
// About birds
|
||||
furi_assert(subghz->file_name[SUBGHZ_MAX_LEN_NAME] == 0);
|
||||
furi_assert(subghz->file_name_tmp[SUBGHZ_MAX_LEN_NAME] == 0);
|
||||
|
||||
// The rest
|
||||
free(subghz);
|
||||
}
|
||||
@@ -315,7 +319,7 @@ int32_t subghz_app(void* p) {
|
||||
string_init(filename);
|
||||
|
||||
path_extract_filename_no_ext(p, filename);
|
||||
strcpy(subghz->file_name, string_get_cstr(filename));
|
||||
strncpy(subghz->file_name, string_get_cstr(filename), SUBGHZ_MAX_LEN_NAME);
|
||||
string_clear(filename);
|
||||
if((!strcmp(subghz->txrx->decoder_result->protocol->name, "RAW"))) {
|
||||
//Load Raw TX
|
||||
|
Reference in New Issue
Block a user