diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-09-20 18:56:47 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-09-20 18:56:47 (GMT) |
commit | ca8aa4acf6755dd012706e1e38fb737ae83ab5c6 (patch) | |
tree | 310b20a536a99dd80657e2d22e07bb1466d0a895 /Modules/_elementtree.c | |
parent | 1c47222a256f2977dcbb36c05dce7a5ae8e6ae06 (diff) | |
download | cpython-ca8aa4acf6755dd012706e1e38fb737ae83ab5c6.zip cpython-ca8aa4acf6755dd012706e1e38fb737ae83ab5c6.tar.gz cpython-ca8aa4acf6755dd012706e1e38fb737ae83ab5c6.tar.bz2 |
Issue #15144: Fix possible integer overflow when handling pointers as integer values, by using Py_uintptr_t instead of size_t.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Modules/_elementtree.c')
-rw-r--r-- | Modules/_elementtree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 6f17d80..43f9d9b 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -98,7 +98,7 @@ do { memory -= size; printf("%8d - %s\n", memory, comment); } while (0) info. */ #define JOIN_GET(p) ((Py_uintptr_t) (p) & 1) #define JOIN_SET(p, flag) ((void*) ((Py_uintptr_t) (JOIN_OBJ(p)) | (flag))) -#define JOIN_OBJ(p) ((PyObject*) ((Py_uintptr_t) (p) & ~1)) +#define JOIN_OBJ(p) ((PyObject*) ((Py_uintptr_t) (p) & ~(Py_uintptr_t)1)) /* glue functions (see the init function for details) */ static PyObject* elementtree_parseerror_obj; |