From: Pierre Joye Date: Mon, 25 Sep 2006 09:09:53 +0000 (+0000) Subject: - MFB: #38944, freshly created archive has no comment or cdir X-Git-Tag: RELEASE_1_0_0RC1~1551 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c82408cd25620de0016684b1d539a415a26cef87;p=php - MFB: #38944, freshly created archive has no comment or cdir --- 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)