com php-src: - Moved NULL check before dereferencing: ext/zip/php_zip.c
| From: | Felipe Pena | Date: | Sun, 20 Oct 2013 11:50:11 +0000 |
| Subject: | com php-src: - Moved NULL check before dereferencing: ext/zip/php_zip.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-73740@lists.php.net to get a copy of this message | ||
Commit: 9976b5cd7f36d90b49d1dcf58ec6497f0e592b7d
Author: Felipe Pena <felipensp@gmail.com> Sun, 20 Oct 2013 09:50:11 -0200
Parents: 52555a78946cd91034f86eb4ad03c2d76cbef0cd
Branches: PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9976b5cd7f36d90b49d1dcf58ec6497f0e592b7d
Log:
- Moved NULL check before dereferencing
Changed paths:
M ext/zip/php_zip.c
Diff:
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index df16383..1f435bb 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) {