diff options
author | Pierre Joye <pajoye@php.net> | 2006-09-25 09:09:53 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2006-09-25 09:09:53 +0000 |
commit | c82408cd25620de0016684b1d539a415a26cef87 (patch) | |
tree | dff51f1a1a6a482cae68a9633fb8f952afc17fae | |
parent | 0fcfad3e5d3d3c4257e5196b6ec3a0029bd27535 (diff) | |
download | php-git-c82408cd25620de0016684b1d539a415a26cef87.tar.gz |
- MFB: #38944, freshly created archive has no comment or cdir
-rw-r--r-- | ext/zip/lib/zip_get_archive_comment.c | 8 |
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) |