diff options
| -rw-r--r-- | ext/standard/crypt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index b147f88b0f..9b06de8070 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -145,8 +145,15 @@ PHP_FUNCTION(crypt) salt[2] = '\0'; #endif } - - RETVAL_STRING(crypt(str, salt), 1); +#ifdef HAVE_CRYPT_R + { + struct crypt_data buffer; + memset(&buffer, 0, sizeof(buffer)); + RETURN_STRING(crypt_r(str, salt, &buffer)); + } +#else + RETURN_STRING(crypt(str, salt), 1); +#endif } /* }}} */ #endif |
