summaryrefslogtreecommitdiff
path: root/ext/zip/lib
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2006-09-25 09:00:16 +0000
committerPierre Joye <pajoye@php.net>2006-09-25 09:00:16 +0000
commit07b62da9f4976524a8cd325cff1638fb64797c73 (patch)
tree56bc785c3700e2b2f29645bc6a8c977f734426f6 /ext/zip/lib
parentcd7f3a786dc4b2d372d27a8fbdd437ef3c7fdb10 (diff)
downloadphp-git-07b62da9f4976524a8cd325cff1638fb64797c73.tar.gz
- #38944, freshly created archive has no comment or cdir
Diffstat (limited to 'ext/zip/lib')
-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..40feb4eba1 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)