Skip to content

Commit 2783706

Browse files
committed
Adding memset to initialize a local struct instance
to avoid unpredictable behavior while running. valgrind complained about it. modified: fuzz_findfuncbypc.c
1 parent e75cc02 commit 2783706

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fuzz/fuzz_findfuncbypc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
112112
char real_path[PATH_LEN];
113113
struct target_data_s target_data;
114114

115+
/* Added 19 May 2023 so valgrind will not complain
116+
about testing uninitialized values in
117+
check_coup_dir (for example). */
118+
memset(&target_data,0,sizeof(target_data));
115119
int res =
116120
dwarf_init_path(filepath, 0, 0, DW_GROUPNUMBER_ANY, 0, 0, &dbg, &error);
117121
if (res == DW_DLV_ERROR) {

0 commit comments

Comments
 (0)