com php-src: Securely zero the hash context key: ext/hash/hash.c

[email protected] (Sara Golemon)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    bf0f53270f3deaf53b887fbd90971d9789dc9311
Author:    Sara Golemon <[email protected]>         Mon, 30 Jan 2017 08:57:17 -0800
Parents:   368958b3e4ad341da02c901bfd58296d55d91605
Branches:  PHP-7.0 PHP-7.1 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=bf0f53270f3deaf53b887fbd90971d9789dc9311

Log:
Securely zero the hash context key

Changed paths:
  M  ext/hash/hash.c


Diff:
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 0b05d28..59d2fbf 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -783,7 +783,7 @@ static void php_hash_dtor(zend_resource *rsrc) /* {{{ */
 	}
 
 	if (hash->key) {
-		memset(hash->key, 0, hash->ops->block_size);
+		ZEND_SECURE_ZERO(hash->key, hash->ops->block_size);
 		efree(hash->key);
 	}
 	efree(hash);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.