]> granicus.if.org Git - php/commitdiff
- hexlen is 2*digestlen
authorMichael Wallner <mike@php.net>
Tue, 22 Nov 2005 19:23:55 +0000 (19:23 +0000)
committerMichael Wallner <mike@php.net>
Tue, 22 Nov 2005 19:23:55 +0000 (19:23 +0000)
ext/hash/hash_md.c
ext/hash/hash_sha.c

index dbed4bb9f98b4b3f230a16f795e76e730ca3ef6e..2270b3fd2d9af93c99c6a928d77569713e5adade 100644 (file)
@@ -35,7 +35,7 @@ php_hash_ops php_hash_md5_ops = {
 PHP_HASH_API void make_digest(char *md5str, unsigned char *digest)
 {
        php_hash_bin2hex(md5str, digest, 16);
-       md5str[16] = '\0';
+       md5str[32] = '\0';
 }
 
 /* {{{ proto string md5(string str, [ bool raw_output])
index 2d1e4c7a94e1e389b305d0a8ef28e02aeed5ae48..b30a75d2e2b640dd5cc9fa87f60646fac1ef7290 100644 (file)
@@ -90,7 +90,7 @@ php_hash_ops php_hash_sha1_ops = {
 PHP_HASH_API void make_sha1_digest(char *sha1str, unsigned char *digest)
 {
        php_hash_bin2hex(sha1str, digest, 20);
-       sha1str[20] = '\0';
+       sha1str[40] = '\0';
 }
 
 /* {{{ proto string sha1(string str [, bool raw_output])