diff options
| author | Nikita Sobolev <mail@sobolevn.me> | 2024-03-08 10:49:52 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-08 10:49:52 (GMT) |
| commit | fdb2d90a274158aee23b526d972172bf41bd4b7e (patch) | |
| tree | 50693d16fd4d8ecf83325cae58ce0652cfe7211d /Modules/arraymodule.c | |
| parent | 0003285c8d78f0b463f2acc164655456fcfc3206 (diff) | |
| download | cpython-fdb2d90a274158aee23b526d972172bf41bd4b7e.zip cpython-fdb2d90a274158aee23b526d972172bf41bd4b7e.tar.gz cpython-fdb2d90a274158aee23b526d972172bf41bd4b7e.tar.bz2 | |
gh-116447: Fix possible UB in `arraymodule` and `getargs` (#116459)
Diffstat (limited to 'Modules/arraymodule.c')
| -rw-r--r-- | Modules/arraymodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index df09d9d..317f497 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -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; } |
