Commit 4a757609 authored by Benjamin Peterson's avatar Benjamin Peterson

do not memcpy from NULL

parent a1bc246d
...@@ -327,7 +327,8 @@ _Py_hashtable_set(_Py_hashtable_t *ht, const void *key, ...@@ -327,7 +327,8 @@ _Py_hashtable_set(_Py_hashtable_t *ht, const void *key,
entry->key_hash = key_hash; entry->key_hash = key_hash;
assert(data_size == ht->data_size); assert(data_size == ht->data_size);
memcpy(_Py_HASHTABLE_ENTRY_DATA(entry), data, data_size); if (data)
memcpy(_Py_HASHTABLE_ENTRY_DATA(entry), data, data_size);
_Py_slist_prepend(&ht->buckets[index], (_Py_slist_item_t*)entry); _Py_slist_prepend(&ht->buckets[index], (_Py_slist_item_t*)entry);
ht->entries++; ht->entries++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment