summaryrefslogtreecommitdiff
path: root/ext/zip
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2013-10-17 10:40:43 +0200
committerAnatol Belski <ab@php.net>2013-10-17 10:40:43 +0200
commitcf6ab0e915f95f01a8db1ce7daf70ed36cf49c66 (patch)
treec4fd681e0b62ad67d2b2ef9101c5e59cae8f0bc2 /ext/zip
parente30b2aae5ad93405eee19bca6125ea872f409c82 (diff)
downloadphp-git-cf6ab0e915f95f01a8db1ce7daf70ed36cf49c66.tar.gz
applied and fixed the original patch
initial work on the patch import done
Diffstat (limited to 'ext/zip')
-rw-r--r--ext/zip/php_zip.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 969bac1aa6..59e026baa2 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -154,7 +154,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
size_t path_cleaned_len;
cwd_state new_state;
- new_state.cwd = (char*)malloc(1);
+ new_state.cwd = (char*)emalloc(1);
new_state.cwd[0] = '\0';
new_state.cwd_length = 0;
@@ -191,7 +191,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
if (ZIP_OPENBASEDIR_CHECKPATH(file_dirname_fullpath)) {
efree(file_dirname_fullpath);
efree(file_basename);
- free(new_state.cwd);
+ efree(new_state.cwd);
return 0;
}
}
@@ -215,7 +215,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
efree(file_dirname_fullpath);
if (!is_dir_only) {
efree(file_basename);
- free(new_state.cwd);
+ efree(new_state.cwd);
}
return 0;
}
@@ -224,7 +224,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
/* it is a standalone directory, job done */
if (is_dir_only) {
efree(file_dirname_fullpath);
- free(new_state.cwd);
+ efree(new_state.cwd);
return 1;
}
@@ -232,13 +232,13 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
if (!len) {
efree(file_dirname_fullpath);
efree(file_basename);
- free(new_state.cwd);
+ efree(new_state.cwd);
return 0;
} else if (len > MAXPATHLEN) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Full extraction path exceed MAXPATHLEN (%i)", MAXPATHLEN);
efree(file_dirname_fullpath);
efree(file_basename);
- free(new_state.cwd);
+ efree(new_state.cwd);
return 0;
}
@@ -250,7 +250,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
efree(fullpath);
efree(file_dirname_fullpath);
efree(file_basename);
- free(new_state.cwd);
+ efree(new_state.cwd);
return 0;
}
@@ -285,7 +285,7 @@ done:
efree(fullpath);
efree(file_basename);
efree(file_dirname_fullpath);
- free(new_state.cwd);
+ efree(new_state.cwd);
if (n<0) {
return 0;