diff options
author | Pierre Joye <pajoye@php.net> | 2006-08-13 21:09:59 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2006-08-13 21:09:59 +0000 |
commit | 8d07735332892b44880d701ffe6f8e119181dd8d (patch) | |
tree | be23ba4c3c01548566fbefbfa383ca4e0a79dae3 /ext/zip/lib/zip_replace.c | |
parent | 0587fb32ba65012aee28c6167900c9930256667b (diff) | |
download | php-git-8d07735332892b44880d701ffe6f8e119181dd8d.tar.gz |
- MFP:
- add overwrite mode to ZipArchive::open, always starts a new archive
- Fix safe mode checks on extract
- Fix possible leaks when a safe mode error has been raised
Diffstat (limited to 'ext/zip/lib/zip_replace.c')
-rw-r--r-- | ext/zip/lib/zip_replace.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/zip/lib/zip_replace.c b/ext/zip/lib/zip_replace.c index 011bbc2af0..ae78e62b80 100644 --- a/ext/zip/lib/zip_replace.c +++ b/ext/zip/lib/zip_replace.c @@ -66,11 +66,14 @@ _zip_replace(struct zip *za, int idx, const char *name, return -1; idx = za->nentry - 1; } - + + _zip_unchange_data(za->entry+idx); if (name && _zip_set_name(za, idx, name) != 0) return -1; + + za->entry[idx].state = ((za->cdir == NULL || idx >= za->cdir->nentry) ? ZIP_ST_ADDED : ZIP_ST_REPLACED); za->entry[idx].source = source; |