Subghz: fix crash on arg free (#815)

This commit is contained in:
あく 2021-11-12 18:45:51 +03:00 committed by GitHub
parent 558fa5670b
commit 70d0519178
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -288,6 +288,8 @@ int32_t subghz_app(void* p) {
// Check argument and run corresponding scene // Check argument and run corresponding scene
if(p && subghz_key_load(subghz, p)) { if(p && subghz_key_load(subghz, p)) {
string_t filename; string_t filename;
string_init(filename);
path_extract_filename_no_ext(p, filename); path_extract_filename_no_ext(p, filename);
strlcpy( strlcpy(
subghz->file_name, string_get_cstr(filename), strlen(string_get_cstr(filename)) + 1); subghz->file_name, string_get_cstr(filename), strlen(string_get_cstr(filename)) + 1);