1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00

MFB: Use reantrant crypt_r() whenever possible.

This commit is contained in:
Ilia Alshanetsky
2006-11-30 16:00:05 +00:00
parent 55ebcb9f7e
commit 053747b512
+9 -2
View File
@@ -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