Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 94c3452

Browse files
committed
Fix bug reported by [email protected]; 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.
1 parent 137507e commit 94c3452

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/pypcre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ else
10641064
c -= '0';
10651065
while(i++ < 2 && (pcre_ctypes[ptr[1]] & ctype_digit) != 0 &&
10661066
ptr[1] != '8' && ptr[1] != '9')
1067-
c = c * 8 + *(++ptr) - '0';
1067+
c = (c * 8 + *(++ptr) - '0') & 255;
10681068
break;
10691069

10701070
/* Special escapes not starting with a digit are straightforward */

0 commit comments

Comments
 (0)