Skip to content

Commit 51771ed

Browse files
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Fix undefined behaviour in strnatcmp update NEWS move the test to the right place Fixed bug #68545 NULL pointer dereference in unserialize.c
2 parents 2e5de0c + f804a36 commit 51771ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/standard/strnatcmp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len
117117
ca = *ap; cb = *bp;
118118

119119
/* skip over leading zeros */
120-
while (leading && ca == '0' && (ap+1 < aend) && isdigit(*(ap+1))) {
120+
while (leading && ca == '0' && (ap+1 < aend) && isdigit((int)(unsigned char)*(ap+1))) {
121121
ca = *++ap;
122122
}
123123

124-
while (leading && cb == '0' && (bp+1 < bend) && isdigit(*(bp+1))) {
124+
while (leading && cb == '0' && (bp+1 < bend) && isdigit((int)(unsigned char)*(bp+1))) {
125125
cb = *++bp;
126126
}
127127

0 commit comments

Comments
 (0)