]> granicus.if.org Git - php/commitdiff
- Moved NULL check before dereferencing
authorFelipe Pena <felipensp@gmail.com>
Sun, 20 Oct 2013 11:50:11 +0000 (09:50 -0200)
committerFelipe Pena <felipensp@gmail.com>
Sun, 20 Oct 2013 11:50:11 +0000 (09:50 -0200)
ext/zip/php_zip.c

index df16383d10403977cd4a2cce8bd51f9e188cbdbb..1f435bbb002ed00b47964fbd6e3b1cea9b161c07 100644 (file)
@@ -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) {