File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed
Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -6289,24 +6289,14 @@ load_mark(UnpicklerObject *self)
62896289 */
62906290
62916291 if (self -> num_marks >= self -> marks_size ) {
6292- size_t alloc ;
6293-
6294- /* Use the size_t type to check for overflow. */
6295- alloc = ((size_t )self -> num_marks << 1 ) + 20 ;
6296- if (alloc > (PY_SSIZE_T_MAX / sizeof (Py_ssize_t )) ||
6297- alloc <= ((size_t )self -> num_marks + 1 )) {
6298- PyErr_NoMemory ();
6299- return -1 ;
6300- }
6301-
6302- Py_ssize_t * marks_old = self -> marks ;
6303- PyMem_RESIZE (self -> marks , Py_ssize_t , alloc );
6304- if (self -> marks == NULL ) {
6305- PyMem_FREE (marks_old );
6306- self -> marks_size = 0 ;
6292+ size_t alloc = ((size_t )self -> num_marks << 1 ) + 20 ;
6293+ Py_ssize_t * marks_new = self -> marks ;
6294+ PyMem_RESIZE (marks_new , Py_ssize_t , alloc );
6295+ if (marks_new == NULL ) {
63076296 PyErr_NoMemory ();
63086297 return -1 ;
63096298 }
6299+ self -> marks = marks_new ;
63106300 self -> marks_size = (Py_ssize_t )alloc ;
63116301 }
63126302
You can’t perform that action at this time.
0 commit comments