Skip to content

Commit 482336d

Browse files
committed
potential overflow fix
1 parent e83099b commit 482336d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_functoolsmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ partial_vectorcall(PyObject *self, PyObject *const *args,
506506
/* Resize Stack if the removing overallocation saves some noticable memory
507507
* NOTE: This whole block can be removed without breaking anything */
508508
Py_ssize_t noveralloc = n_merges + nkwds;
509-
if (stack != small_stack && noveralloc > 6 && noveralloc * 10 > init_stack_size) {
509+
if (stack != small_stack && noveralloc > 6 && noveralloc > init_stack_size / 10) {
510510
tmp_stack = PyMem_Realloc(stack, (tot_nargskw - n_merges) * sizeof(PyObject *));
511511
if (tmp_stack == NULL) {
512512
Py_DECREF(tot_kwnames);

0 commit comments

Comments
 (0)