mirror of
https://github.com/python/cpython.git
synced 2025-10-08 08:01:55 +00:00
gh-116447: Fix possible UB in arraymodule
and getargs
(#116459)
This commit is contained in:
parent
0003285c8d
commit
fdb2d90a27
2 changed files with 3 additions and 3 deletions
|
@ -247,7 +247,7 @@ BB_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
|
|||
if (!PyArg_Parse(v, "b;array item must be integer", &x))
|
||||
return -1;
|
||||
if (i >= 0)
|
||||
((char *)ap->ob_item)[i] = x;
|
||||
((unsigned char *)ap->ob_item)[i] = x;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue