diff options
author | Andy Lester <andy@petdance.com> | 2020-03-25 04:26:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-25 04:26:44 (GMT) |
commit | 7668a8bc93c2bd573716d1bea0f52ea520502b28 (patch) | |
tree | 0c6dce63a06466c3f9136df09f5cd928d20e5c55 /Modules/_winapi.c | |
parent | 7dd549eb08939e1927fba818116f5202e76f8d73 (diff) | |
download | cpython-7668a8bc93c2bd573716d1bea0f52ea520502b28.zip cpython-7668a8bc93c2bd573716d1bea0f52ea520502b28.tar.gz cpython-7668a8bc93c2bd573716d1bea0f52ea520502b28.tar.bz2 |
Use calloc-based functions, not malloc. (GH-19152)
Diffstat (limited to 'Modules/_winapi.c')
-rw-r--r-- | Modules/_winapi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/_winapi.c b/Modules/_winapi.c index 647075c..5dc50fb 100644 --- a/Modules/_winapi.c +++ b/Modules/_winapi.c @@ -603,11 +603,10 @@ _winapi_CreateJunction_impl(PyObject *module, LPWSTR src_path, sizeof(rdb->MountPointReparseBuffer.PathBuffer) + /* Two +1's for NUL terminators. */ (prefix_len + print_len + 1 + print_len + 1) * sizeof(WCHAR); - rdb = (_Py_PREPARSE_DATA_BUFFER)PyMem_RawMalloc(rdb_size); + rdb = (_Py_PREPARSE_DATA_BUFFER)PyMem_RawCalloc(1, rdb_size); if (rdb == NULL) goto cleanup; - memset(rdb, 0, rdb_size); rdb->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT; rdb->ReparseDataLength = rdb_size - _Py_REPARSE_DATA_BUFFER_HEADER_SIZE; rdb->MountPointReparseBuffer.SubstituteNameOffset = 0; |