fix: добавление проверки malloc

This commit is contained in:
Artyom Gavrilov
2025-02-06 00:29:27 +03:00
parent b832541766
commit 49304cc111

View File

@@ -289,6 +289,9 @@ static int parse_fake_custom_payload(
return -EINVAL;
}
unsigned char *custom_buf = malloc(custom_len);
if (custom_buf == NULL) {
return -ENOMEM;
}
for (int i = 0; i < custom_len; i++) {
ret = sscanf(custom_hex_fake + (i << 1), "%2hhx", custom_buf + i);