Fix buffer overrun

This commit is contained in:
Michael Droettboom 2018-12-28 10:19:51 -05:00
parent e3f93470c9
commit a7e13e5307
1 changed files with 2 additions and 2 deletions

View File

@ -428,9 +428,9 @@ static enum shareable_enum
_python2js_buffer_is_shareable(Py_buffer* buff)
{
char* invalid_codes = ">!qQ?";
for (int i = 0; i < 2; ++i) {
for (char* i = buff->format; *i != 0; ++i) {
for (char* j = invalid_codes; *j != 0; ++j) {
if (buff->format[i] == *j) {
if (*i == *j) {
return NOT_SHAREABLE;
}
}