diff options
author | Yasuo Ohgaki <yohgaki@php.net> | 2013-10-22 12:27:47 +0900 |
---|---|---|
committer | Yasuo Ohgaki <yohgaki@php.net> | 2013-10-22 12:27:47 +0900 |
commit | 6410f6ff68ebd1e0fdd27ba4870900967d569926 (patch) | |
tree | 3ed49efc15f24063a49ad64e1939c957b2b4f850 /ext/zip/php_zip.c | |
parent | 7be3c743392fbf1837760393403c7b703e502d3a (diff) | |
parent | b6ceea4a25f667bfed6c26899dd55a274a3270d3 (diff) | |
download | php-git-6410f6ff68ebd1e0fdd27ba4870900967d569926.tar.gz |
Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src: (178 commits)
Fixed bug #65939 (Space before ";" breaks php.ini parsing). (brainstorm at nopcode dot org)
exif NEWS
add tests for bug #62523
Merged PR #293 (Exif crash on unknown encoding was fixed) By: Draal Conflicts: configure.in main/php_version.h
fix bug #65936 (dangling context pointer causes crash)
remove TRAVIS check in test source
Fixed compilation warning
Just SKIP that test on travis
Fixed issue #115 (path issue when using phar).
fix memory leak on error (from Coverity scan)
Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag
5.4.21 release date
fix argument type & remove warning
fix const warnings in intl methods
When src->src is null this doesn't get initialized but it is still used, so the passed in *ze will point to unitialized memory. Hopefully src->src is never null, but just in case this initialization doesn't hurt.
Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag
fix possibility of access to *storedType without initialization
5.4.21 release date
Fix typo
These getpwnam('') tests are silly and not portable
...
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r-- | ext/zip/php_zip.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 7297523aaa..d3ec27bafe 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -102,14 +102,14 @@ static char * php_zip_make_relative_path(char *path, int path_len) /* {{{ */ char *path_begin = path; size_t i; - if (IS_SLASH(path[0])) { - return path + 1; - } - if (path_len < 1 || path == NULL) { return NULL; } + if (IS_SLASH(path[0])) { + return path + 1; + } + i = path_len; while (1) { @@ -1856,15 +1856,16 @@ static ZIPARCHIVE_METHOD(addFromString) /* TODO: fix _zip_replace */ if (cur_idx >= 0) { if (zip_delete(intern, cur_idx) == -1) { - RETURN_FALSE; + goto fail; } } - if (zip_add(intern, name, zs) == -1) { - RETURN_FALSE; - } else { + if (zip_add(intern, name, zs) != -1) { RETURN_TRUE; } +fail: + zip_source_free(zs); + RETURN_FALSE; } /* }}} */ |