diff options
author | Steve Dower <steve.dower@microsoft.com> | 2017-02-04 14:55:16 -0800 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2017-02-04 14:55:16 -0800 |
commit | b53654b6dbfce8318a7d4d1cdaddca7a7fec194b (patch) | |
tree | 204df61b2fb23424603db767732db35a687529c6 /Python/mystrtoul.c | |
parent | e1ac7d87afad9c07ec25e5705bb135b71347b581 (diff) | |
parent | 2296b978597ce62ec2185b78a43811610af2c0ea (diff) | |
download | cpython-b53654b6dbfce8318a7d4d1cdaddca7a7fec194b.tar.gz |
Issue #29416: Prevent infinite loop in pathlib.Path.mkdir
Diffstat (limited to 'Python/mystrtoul.c')
-rw-r--r-- | Python/mystrtoul.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/mystrtoul.c b/Python/mystrtoul.c index 98429d4b42..a85790e1bf 100644 --- a/Python/mystrtoul.c +++ b/Python/mystrtoul.c @@ -17,7 +17,7 @@ * smallmax[base] is the largest unsigned long i such that * i * base doesn't overflow unsigned long. */ -static unsigned long smallmax[] = { +static const unsigned long smallmax[] = { 0, /* bases 0 and 1 are invalid */ 0, ULONG_MAX / 2, @@ -62,14 +62,14 @@ static unsigned long smallmax[] = { * Note that this is pessimistic if sizeof(long) > 4. */ #if SIZEOF_LONG == 4 -static int digitlimit[] = { +static const int digitlimit[] = { 0, 0, 32, 20, 16, 13, 12, 11, 10, 10, /* 0 - 9 */ 9, 9, 8, 8, 8, 8, 8, 7, 7, 7, /* 10 - 19 */ 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, /* 20 - 29 */ 6, 6, 6, 6, 6, 6, 6}; /* 30 - 36 */ #elif SIZEOF_LONG == 8 /* [int(math.floor(math.log(2**64, i))) for i in range(2, 37)] */ -static int digitlimit[] = { +static const int digitlimit[] = { 0, 0, 64, 40, 32, 27, 24, 22, 21, 20, /* 0 - 9 */ 19, 18, 17, 17, 16, 16, 16, 15, 15, 15, /* 10 - 19 */ 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, /* 20 - 29 */ |