There was an error while loading. Please reload this page.
1 parent 13d31fe commit ebb58e9Copy full SHA for ebb58e9
1 file changed
Modules/hmacmodule.c
@@ -741,8 +741,12 @@ hmac_new_object(PyTypeObject *tp)
741
return NULL;
742
}
743
HASHLIB_INIT_MUTEX(self);
744
- // tp_alloc initializes the memory to zero but the unknown kind is -1
+ // PyObject_GC_New() does not zero-initialize
745
+ self->name = NULL;
746
self->kind = Py_hmac_kind_hash_unknown;
747
+ self->block_size = self->digest_size = 0;
748
+ self->api = (py_hmac_hacl_api){.compute = NULL, .compute_py = NULL};
749
+ self->state = NULL;
750
return self;
751
752
0 commit comments