From 2ab5a70b9f2ba6b1d8b3cb56a2dbe1d82e8d6d31 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sat, 16 Nov 2019 11:18:50 -0800 Subject: [PATCH] ziptool: fix unknown long options. Previously an unknown long option would cause a crash as we ran off the end of the array. Test: `ziptool unzip --unknown` Change-Id: I7a7b6ac4a0fa157c111f936e837c20143cef9e28 --- libziparchive/unzip.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libziparchive/unzip.cpp b/libziparchive/unzip.cpp index 56f594a44..11b575eae 100644 --- a/libziparchive/unzip.cpp +++ b/libziparchive/unzip.cpp @@ -448,6 +448,7 @@ int main(int argc, char* argv[]) { static const struct option opts[] = { {"help", no_argument, 0, 'h'}, + {}, }; if (role == kUnzip) {