]>
Commit | Line | Data |
---|---|---|
1 | --- php-5.2.17/ext/standard/crypt.c~ 2013-03-25 17:26:27.000000000 +0100 | |
2 | +++ php-5.2.17/ext/standard/crypt.c 2013-03-25 17:27:42.866436012 +0100 | |
3 | @@ -118,6 +118,7 @@ | |
4 | Encrypt a string */ | |
5 | PHP_FUNCTION(crypt) | |
6 | { | |
7 | + char *crypt_res; | |
8 | char salt[PHP_MAX_SALT_LEN+1]; | |
9 | char *str, *salt_in = NULL; | |
10 | int str_len, salt_in_len; | |
11 | @@ -163,7 +163,12 @@ | |
12 | RETURN_STRING(crypt_r(str, salt, &buffer), 1); | |
13 | } | |
14 | #else | |
15 | - RETURN_STRING(crypt(str, salt), 1); | |
16 | + crypt_res = crypt(str, salt); | |
17 | + if (!crypt_res) { | |
18 | + RETURN_FALSE; | |
19 | + } else { | |
20 | + RETURN_STRING(crypt_res, 1); | |
21 | + } | |
22 | #endif | |
23 | } | |
24 | /* }}} */ |