diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-03-08 11:22:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-08 11:22:07 (GMT) |
commit | 2647afeab694517933c53028d4ad427460b9e1fa (patch) | |
tree | 434da2a4d3743d0ef1769253bd85d033edfde7cc /Modules | |
parent | a8a95135a204d6ad5de55b0972ad44bfe9ccf0b2 (diff) | |
download | cpython-2647afeab694517933c53028d4ad427460b9e1fa.zip cpython-2647afeab694517933c53028d4ad427460b9e1fa.tar.gz cpython-2647afeab694517933c53028d4ad427460b9e1fa.tar.bz2 |
[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 fdb2d90a274158aee23b526d972172bf41bd4b7e)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Diffstat (limited to 'Modules')
-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 6680820..19ee83d 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -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; } |