Commit a7e13e53 authored by Michael Droettboom's avatar Michael Droettboom

Fix buffer overrun

parent e3f93470
...@@ -428,9 +428,9 @@ static enum shareable_enum ...@@ -428,9 +428,9 @@ static enum shareable_enum
_python2js_buffer_is_shareable(Py_buffer* buff) _python2js_buffer_is_shareable(Py_buffer* buff)
{ {
char* invalid_codes = ">!qQ?"; 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) { for (char* j = invalid_codes; *j != 0; ++j) {
if (buff->format[i] == *j) { if (*i == *j) {
return NOT_SHAREABLE; return NOT_SHAREABLE;
} }
} }
......
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