fixed a valgrind memory usage of uninitialised array

This commit is contained in:
iceman1001 committed 2024-04-25 07:29:22 +02:00
1 parent d635f39048
commit 36603818d1
2 files changed
+4 -1

No files matched your search

+3 -1
View File
@@ -289,8 +289,9 @@ int CmdLFCommandRead(const char *Cmd) {
bool cm = arg_get_lit(ctx, 10);
CLIParserFree(ctx);
if (g_session.pm3_present == false)
if (g_session.pm3_present == false) {
return PM3_ENOTTY;
}
#define PAYLOAD_HEADER_SIZE (12 + (3 * LF_CMDREAD_MAX_EXTRA_SYMBOLS))
struct p {
@@ -311,6 +312,7 @@ int CmdLFCommandRead(const char *Cmd) {
payload.keep_field_on = keep_field_on;
payload.verbose = verbose;
memset(payload.symbol_extra, 0, sizeof(payload.symbol_extra));
memset(payload.period_extra, 0, sizeof(payload.period_extra));
if (add_crc_ht && (cmd_len <= 120)) {
// Hitag 1, Hitag S, ZX8211