com php-src: virtual_file_ex uses emalloc in 5. 6+: ext/phar/phar_object.c

From: Date: Tue, 04 Aug 2015 23:31:57 +0000
Subject: com php-src: virtual_file_ex uses emalloc in 5. 6+: ext/phar/phar_object.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-88322@lists.php.net to get a copy of this message
Commit: eb7ba73079b73ca4ef91307ae1ef30b43468717b Author: Stanislav Malyshev <stas@php.net> Tue, 4 Aug 2015 16:31:57 -0700 Parents: 568a35f84f934d1fe1b9817b4226cf2bd9d8f4cc Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=eb7ba73079b73ca4ef91307ae1ef30b43468717b Log: virtual_file_ex uses emalloc in 5.6+ Changed paths: M ext/phar/phar_object.c Diff: diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 22d59c2..d7c9541 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -4132,7 +4132,7 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char * return SUCCESS; } /* strip ... from path and restrict it to be under dest directory */ - new_state.cwd = (char*)malloc(2); + new_state.cwd = (char*)emalloc(2); new_state.cwd[0] = DEFAULT_SLASH; new_state.cwd[1] = '\0'; new_state.cwd_length = 1; @@ -4145,7 +4145,7 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char * } else { spprintf(error, 4096, "Cannot extract \"%s\", internal error", entry->filename); } - free(new_state.cwd); + efree(new_state.cwd); return FAILURE; } filename = new_state.cwd + 1; @@ -4177,21 +4177,21 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char * spprintf(error, 4096, "Cannot extract \"%s\" to \"%s...\", extracted filename is too long for filesystem", entry->filename, fullpath); } efree(fullpath); - free(new_state.cwd); + efree(new_state.cwd); return FAILURE; } if (!len) { spprintf(error, 4096, "Cannot extract \"%s\", internal error", entry->filename); efree(fullpath); - free(new_state.cwd); + efree(new_state.cwd); return FAILURE; } if (PHAR_OPENBASEDIR_CHECKPATH(fullpath)) { spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", openbasedir/safe mode restrictions in effect", entry->filename, fullpath); efree(fullpath); - free(new_state.cwd); + efree(new_state.cwd); return FAILURE; } @@ -4199,7 +4199,7 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char * if (!overwrite && SUCCESS == php_stream_stat_path(fullpath, &ssb)) { spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", path already exists", entry->filename, fullpath); efree(fullpath); - free(new_state.cwd); + efree(new_state.cwd); return FAILURE; } @@ -4237,7 +4237,7 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char * } filename = NULL; - free(new_state.cwd); + efree(new_state.cwd); /* it is a standalone directory, job done */ if (entry->is_dir) { efree(fullpath);

« previous php.cvs (#88322) next »