summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2006-09-25 09:09:53 +0000
committerPierre Joye <pajoye@php.net>2006-09-25 09:09:53 +0000
commitc82408cd25620de0016684b1d539a415a26cef87 (patch)
treedff51f1a1a6a482cae68a9633fb8f952afc17fae
parent0fcfad3e5d3d3c4257e5196b6ec3a0029bd27535 (diff)
downloadphp-git-c82408cd25620de0016684b1d539a415a26cef87.tar.gz
- MFB: #38944, freshly created archive has no comment or cdir
-rw-r--r--ext/zip/lib/zip_get_archive_comment.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/zip/lib/zip_get_archive_comment.c b/ext/zip/lib/zip_get_archive_comment.c
index 6e68f2f4d9..7844c5e191 100644
--- a/ext/zip/lib/zip_get_archive_comment.c
+++ b/ext/zip/lib/zip_get_archive_comment.c
@@ -45,9 +45,11 @@ zip_get_archive_comment(struct zip *za, int *lenp, int flags)
{
if ((flags & ZIP_FL_UNCHANGED)
|| (za->ch_comment_len == -1)) {
- if (lenp != NULL)
- *lenp = za->cdir->comment_len;
- return za->cdir->comment;
+ if (za->cdir) {
+ if (lenp != NULL)
+ *lenp = za->cdir->comment_len;
+ return za->cdir->comment;
+ }
}
if (lenp != NULL)