mirror of https://github.com/pyodide/pyodide.git
Fix buffer overrun
This commit is contained in:
parent
e3f93470c9
commit
a7e13e5307
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue