mirror of
https://github.com/php/php-src.git
synced 2024-09-24 11:27:28 +00:00
MFB: Use reantrant crypt_r() whenever possible.
This commit is contained in:
parent
55ebcb9f7e
commit
053747b512
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user