Commit d36d4e0d authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #13555: Fix an integer overflow check.

parent 93bfe7d8
...@@ -595,7 +595,7 @@ readline_file(Unpicklerobject *self, char **s) ...@@ -595,7 +595,7 @@ readline_file(Unpicklerobject *self, char **s)
return i + 1; return i + 1;
} }
} }
if (self->buf_size < (PY_SSIZE_T_MAX >> 1)) { if (self->buf_size > (PY_SSIZE_T_MAX >> 1)) {
PyErr_NoMemory(); PyErr_NoMemory();
return -1; return -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment