com php-src: Fixed bug #68809 (Unchecked return value): ext/phar/tar.c

From: Date: Sun, 18 Jan 2015 04:04:41 +0000
Subject: com php-src: Fixed bug #68809 (Unchecked return value): ext/phar/tar.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-84153@lists.php.net to get a copy of this message
Commit: 89beb12fefdfe9a9b56f1db9027d9bfaeb895b31 Author: Xinchen Hui <laruence@php.net> Sat, 17 Jan 2015 23:04:41 -0500 Parents: ad32e033274ea49d05164418241946d2f1798894 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=89beb12fefdfe9a9b56f1db9027d9bfaeb895b31 Log: Fixed bug #68809 (Unchecked return value) Bugs: https://bugs.php.net/68809 Changed paths: M ext/phar/tar.c Diff: diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 6d3daf5..0195a51 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -481,7 +481,14 @@ bail: entry.link = estrdup(hdr->linkname); } phar_set_inode(&entry); - newentry = zend_hash_str_add_mem(&myphar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info)); + if ((newentry = zend_hash_str_add_mem(&myphar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) == NULL) { + if (error) { + spprintf(error, 4096, "phar error: tar-based phar \"%s\" cannot be registered", entry.filename); + } + php_stream_close(fp); + phar_destroy_phar_data(myphar); + return FAILURE; + } if (entry.is_persistent) { ++entry.manifest_pos;

« previous php.cvs (#84153) next »