com php-src: fix thread safety and zeroing method: ext/standard /php_crypt_r.c
| From: | Anatol Belski | Date: | Wed, 29 Jul 2015 15:26:50 +0000 |
| Subject: | com php-src: fix thread safety and zeroing method: ext/standard /php_crypt_r.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88225@lists.php.net to get a copy of this message | ||
Commit: db70a337ff79be773b82e00a7483f69727af25aa
Author: Anatol Belski <ab@php.net> Wed, 29 Jul 2015 13:35:26 +0200
Parents: 2aa9db5a229b60a3b5ad092ec5ec3f53c68bf1d0
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=db70a337ff79be773b82e00a7483f69727af25aa
Log:
fix thread safety and zeroing method
Changed paths:
M ext/standard/php_crypt_r.c
Diff:
diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c
index 39185a6..bb88e08 100644
--- a/ext/standard/php_crypt_r.c
+++ b/ext/standard/php_crypt_r.c
@@ -318,7 +318,7 @@ _destroyProv:
*/
char * php_md5_crypt_r(const char *pw, const char *salt, char *out)
{
- static char passwd[MD5_HASH_MAX_LEN], *p;
+ ZEND_TLS char passwd[MD5_HASH_MAX_LEN], *p;
const char *sp, *ep;
unsigned char final[16];
unsigned int i, sl, pwl;
@@ -418,7 +418,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out)
*p = '\0';
/* Don't leave anything around in vm they could use. */
- memset(final, 0, sizeof(final));
+ ZEND_SECURE_ZERO(final, sizeof(final));
return (passwd);
}