Core: Fix crash modifying hash table entry (fixes #1673)
Vicki Pfau vi@endrift.com
Mon, 17 Feb 2020 17:55:29 -0800
2 files changed,
4 insertions(+),
1 deletions(-)
M
src/util/table.c
→
src/util/table.c
@@ -187,7 +187,9 @@ uint32_t hash = hash32(key, strlen(key), 0);
struct TableList* list; TABLE_LOOKUP_START(HASH_TABLE_COMPARATOR, list, hash) { if (value != lookupResult->value) { - table->deinitializer(lookupResult->value); + if (table->deinitializer) { + table->deinitializer(lookupResult->value); + } lookupResult->value = value; } return;