cvs: /php3/functions mhash.c
| From: | Sascha Schumann | Date: | Mon, 15 Nov 1999 00:02:22 +0000 |
| Subject: | cvs: /php3/functions mhash.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-12537@lists.php.net to get a copy of this message | ||
sas Sun Nov 14 19:02:22 1999 EDT
Modified files:
/php3/functions mhash.c
Log:
(PHP mhash): don't segfault, if mhash_end() returns NULL
Index: php3/functions/mhash.c
diff -u php3/functions/mhash.c:1.3 php3/functions/mhash.c:1.4
--- php3/functions/mhash.c:1.3 Sun Nov 14 06:41:14 1999
+++ php3/functions/mhash.c Sun Nov 14 19:02:21 1999
@@ -149,9 +149,13 @@
hash_data = (unsigned char *) mhash_end(td);
- RETVAL_STRINGL(hash_data, bsize, 1);
+ if (hash_data) {
+ RETVAL_STRINGL(hash_data, bsize, 1);
- free(hash_data);
+ free(hash_data);
+ } else {
+ RETURN_FALSE;
+ }
}
/* }}} */