]> granicus.if.org Git - php/commitdiff
- #38944, freshly created archive has no comment or cdir
authorPierre Joye <pajoye@php.net>
Mon, 25 Sep 2006 09:00:16 +0000 (09:00 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 25 Sep 2006 09:00:16 +0000 (09:00 +0000)
ext/zip/lib/zip_get_archive_comment.c

index 6e68f2f4d9839a4817d62b92726cc13c364980e2..40feb4eba139fc3a3c31f650bb4d427f18c6c9bd 100644 (file)
@@ -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)