diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2000-06-01 03:02:48 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2000-06-01 03:02:48 (GMT) |
commit | 94c3452ade3dbc2c09e772b0507084551fe49b4c (patch) | |
tree | 18ff9285056a639728fc0a1db313239d465d3edf /Modules | |
parent | 137507ea0308fcdab66c1eee700048c41ed7a7d7 (diff) | |
download | cpython-94c3452ade3dbc2c09e772b0507084551fe49b4c.zip cpython-94c3452ade3dbc2c09e772b0507084551fe49b4c.tar.gz cpython-94c3452ade3dbc2c09e772b0507084551fe49b4c.tar.bz2 |
Fix bug reported by atkins@gweep.net; re.compile(r"[\100-\410]")
dumps core. Solution: fix check_escape() to match its comment and
use only the low 8 bits of the octal number.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/pypcre.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/pypcre.c b/Modules/pypcre.c index 468751d..afff59c 100644 --- a/Modules/pypcre.c +++ b/Modules/pypcre.c @@ -1064,7 +1064,7 @@ else c -= '0'; while(i++ < 2 && (pcre_ctypes[ptr[1]] & ctype_digit) != 0 && ptr[1] != '8' && ptr[1] != '9') - c = c * 8 + *(++ptr) - '0'; + c = (c * 8 + *(++ptr) - '0') & 255; break; /* Special escapes not starting with a digit are straightforward */ |