From 52327340714621f2452fc62a6bcbbefda9f46ea7 Mon Sep 17 00:00:00 2001 From: olszomal Date: Wed, 29 May 2024 14:18:10 +0200 Subject: [PATCH] Fix fuzzer error - failed to sort central directory entry --- appx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/appx.c b/appx.c index 5db44bd..d66af5a 100644 --- a/appx.c +++ b/appx.c @@ -2323,6 +2323,12 @@ static ZIP_FILE *zipSortCentralDirectory(ZIP_FILE *zip) } sk_ZIP_CENTRAL_DIRECTORY_ENTRY_sort(chain); zip->centralDirectoryHead = entry = sk_ZIP_CENTRAL_DIRECTORY_ENTRY_value(chain, 0); + if (!entry) { + printf("Failed to get sorted central directory entry\n"); + sk_ZIP_CENTRAL_DIRECTORY_ENTRY_free(chain); + freeZip(zip); + return NULL; + } for (i=1; inext = sk_ZIP_CENTRAL_DIRECTORY_ENTRY_value(chain, i); entry = entry->next;