fix thread safety

This commit is contained in:
Anatol Belski 2015-07-28 21:06:10 +02:00
parent 7d41afeee8
commit 7104d88c35
2 changed files with 4 additions and 4 deletions

View File

@ -596,8 +596,8 @@ char * php_sha256_crypt(const char *key, const char *salt)
password. We can compute an upper bound for the size of the
result in advance and so we can prepare the buffer we pass to
`sha256_crypt_r'. */
static char *buffer;
static int buflen;
ZEND_TLS char *buffer;
ZEND_TLS int buflen = 0;
int needed = (sizeof(sha256_salt_prefix) - 1
+ sizeof(sha256_rounds_prefix) + 9 + 1
+ (int)strlen(salt) + 1 + 43 + 1);

View File

@ -643,8 +643,8 @@ php_sha512_crypt(const char *key, const char *salt) {
password. We can compute an upper bound for the size of the
result in advance and so we can prepare the buffer we pass to
`sha512_crypt_r'. */
static char *buffer;
static int buflen;
ZEND_TLS char *buffer;
ZEND_TLS int buflen = 0;
int needed = (int)(sizeof(sha512_salt_prefix) - 1
+ sizeof(sha512_rounds_prefix) + 9 + 1
+ strlen(salt) + 1 + 86 + 1);