diff --git a/NEWS b/NEWS index 4a7cbd4366a..898325afd16 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,7 @@ PHP NEWS - Core: . Fixed missing bound check in iptcparse(). (chris at chiappa.net) + . Fixed CVE-2012-2143. (Solar Designer) . Fixed bug #62005 (unexpected behavior when incrementally assigning to a member of a null object). (Laruence) . Fixed bug #61998 (Using traits with method aliases appears to result in diff --git a/ext/standard/crypt_freesec.c b/ext/standard/crypt_freesec.c index 49c397cca1a..0a5c3ba5fa7 100644 --- a/ext/standard/crypt_freesec.c +++ b/ext/standard/crypt_freesec.c @@ -629,7 +629,8 @@ _crypt_extended_r(const char *key, const char *setting, */ q = (u_char *) keybuf; while (q - (u_char *) keybuf < sizeof(keybuf)) { - if ((*q++ = *key << 1)) + *q++ = *key << 1; + if (*key) key++; } if (des_setkey((u_char *) keybuf, data)) diff --git a/ext/standard/tests/strings/crypt_chars.phpt b/ext/standard/tests/strings/crypt_chars.phpt new file mode 100644 index 00000000000..09cd8682160 --- /dev/null +++ b/ext/standard/tests/strings/crypt_chars.phpt @@ -0,0 +1,19 @@ +--TEST-- +crypt() function - characters > 0x80 +--SKIPIF-- + +--FILE-- +