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:
@@ -3861,6 +3861,9 @@ byteswriter_create(Py_ssize_t size, int use_bytearray)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#ifdef Py_DEBUG
|
||||
memset(writer->small_buffer, 0xff, sizeof(writer->small_buffer));
|
||||
#endif
|
||||
writer->obj = NULL;
|
||||
writer->size = 0;
|
||||
writer->use_bytearray = use_bytearray;
|
||||
|
||||
Reference in New Issue
Block a user