Skip to content

Commit 9976b5c

Browse files
committed
- Moved NULL check before dereferencing
1 parent 52555a7 commit 9976b5c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/zip/php_zip.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ static char * php_zip_make_relative_path(char *path, int path_len) /* {{{ */
102102
char *path_begin = path;
103103
size_t i;
104104

105-
if (IS_SLASH(path[0])) {
106-
return path + 1;
107-
}
108-
109105
if (path_len < 1 || path == NULL) {
110106
return NULL;
111107
}
112108

109+
if (IS_SLASH(path[0])) {
110+
return path + 1;
111+
}
112+
113113
i = path_len;
114114

115115
while (1) {

0 commit comments

Comments
 (0)