Skip to content

Commit 8c10eaa

Browse files
authored
Prevent uninitialized memory. (#18320)
1 parent ff025a8 commit 8c10eaa

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

database_info.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ char *bin_to_hex_alloc(const uint8_t *data, size_t len)
496496
if (len && !ret)
497497
return NULL;
498498

499+
ret[0] = '\0';
499500
for (i = 0; i < len; i++)
500501
snprintf(ret+i * 2, 3, "%02X", data[i]);
501502
return ret;

0 commit comments

Comments
 (0)