mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
[3.12] gh-116447: Fix possible UB in arraymodule
and getargs
(GH-116459) (#116496)
gh-116447: Fix possible UB in `arraymodule` and `getargs` (GH-116459)
(cherry picked from commit fdb2d90a27
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
a8a95135a2
commit
2647afeab6
2 changed files with 3 additions and 3 deletions
|
@ -244,7 +244,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