addr_resolv.c: fix a stack buffer overflow detected by ASAN

Issue reported by Alexis

Change-Id: I0ef19625b6844fbc2996b75d51e86f949e358c8d
Reviewed-on: https://code.wireshark.org/review/7273
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
Pascal Quantin 2015-02-20 12:47:52 +01:00
parent a99cc2fd0b
commit 9fe9505b46
1 changed files with 1 additions and 1 deletions

View File

@ -1286,7 +1286,7 @@ static hashmanuf_t *manuf_hash_new_entry(const guint8 *addr, char* name)
manuf_value->resolved_name[0] = '\0';
}
/* Values returned by bytes_to_hexstr_punct() are *not* null-terminated */
endp = bytes_to_hexstr_punct(manuf_value->hexaddr, addr, sizeof(manuf_value->hexaddr), ':');
endp = bytes_to_hexstr_punct(manuf_value->hexaddr, addr, sizeof(manuf_value->addr), ':');
*endp = '\0';
g_hash_table_insert(manuf_hashtable, manuf_key, manuf_value);