Subghz: Adding checks for get_upload functions (#1704)

* Adding checks for get_upload functions
  Almost in every protocol, function which generates upload might fail and return false.
  But we don't check this result, which might end up sending random memory contents to the air.
* Format sources and fix crash on ivalid bit count in chamberlain

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Max Lapan
2022-09-20 07:29:10 +02:00
committed by GitHub
parent 066da4080b
commit 3360f818a1
19 changed files with 20 additions and 20 deletions

View File

@@ -193,7 +193,7 @@ bool subghz_protocol_encoder_megacode_deserialize(void* context, FlipperFormat*
flipper_format_read_uint32(
flipper_format, "Repeat", (uint32_t*)&instance->encoder.repeat, 1);
subghz_protocol_encoder_megacode_get_upload(instance);
if(!subghz_protocol_encoder_megacode_get_upload(instance)) break;
instance->encoder.is_running = true;
res = true;