1
0
mirror of https://github.com/php/php-src.git synced 2026-04-07 16:13:32 +02:00

fix memleak found by valgrind

This commit is contained in:
Greg Beaver
2008-03-23 00:05:53 +00:00
parent 15f8facded
commit 62ed0adcca

View File

@@ -592,7 +592,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, char *url, int flags,
if (HASH_KEY_NON_EXISTANT !=
zend_hash_get_current_key_ex(
&phar->manifest, &key, &keylen, &unused, 0, NULL)) {
if (0 == memcmp(internal_file, key, internal_file_len)) {
if (keylen >= internal_file_len && 0 == memcmp(internal_file, key, internal_file_len)) {
/* directory found, all dirs have the same stat */
if (key[internal_file_len] == '/') {
phar_dostat(phar, NULL, ssb, 1, phar->alias, phar->alias_len TSRMLS_CC);