summaryrefslogtreecommitdiff
path: root/ext/standard/crypt_freesec.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2012-05-24 13:54:51 -0500
committerStanislav Malyshev <stas@php.net>2012-05-29 23:07:04 -0700
commitaab49e934de1fff046e659cbec46e3d053b41c34 (patch)
tree91a2d1e7973995c36c91cf8e7d5071843b314d9a /ext/standard/crypt_freesec.c
parent8d5e953a19a08e562448f2a0562228fd1be60715 (diff)
downloadphp-git-aab49e934de1fff046e659cbec46e3d053b41c34.tar.gz
fix CVE-2012-2143
Diffstat (limited to 'ext/standard/crypt_freesec.c')
-rw-r--r--ext/standard/crypt_freesec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/standard/crypt_freesec.c b/ext/standard/crypt_freesec.c
index 49c397cca1..0a5c3ba5fa 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))