mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
gh-129813, PEP 782: Init small_buffer in PyBytesWriter_Create() (#138924)
Fill small_buffer with 0xFF byte pattern to detect the usage of uninitialized bytes in debug build.
This commit is contained in:
parent
f07ae274b8
commit
7c6efc3a4f
1 changed files with 3 additions and 0 deletions
|
|
@ -3861,6 +3861,9 @@ byteswriter_create(Py_ssize_t size, int use_bytearray)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef Py_DEBUG
|
||||||
|
memset(writer->small_buffer, 0xff, sizeof(writer->small_buffer));
|
||||||
|
#endif
|
||||||
writer->obj = NULL;
|
writer->obj = NULL;
|
||||||
writer->size = 0;
|
writer->size = 0;
|
||||||
writer->use_bytearray = use_bytearray;
|
writer->use_bytearray = use_bytearray;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue