commit | 2ab5a70b9f2ba6b1d8b3cb56a2dbe1d82e8d6d31 | [log] [tgz] |
---|---|---|
author | Elliott Hughes <enh@google.com> | Sat Nov 16 11:18:50 2019 -0800 |
committer | Elliott Hughes <enh@google.com> | Sat Nov 16 11:18:50 2019 -0800 |
tree | acd6b2c1eb560d0e9ba7da21dfdf500f97d7895f | |
parent | dc4bd2714cf8a1ae4b606eafac56e12a0f77955e [diff] |
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
diff --git a/libziparchive/unzip.cpp b/libziparchive/unzip.cpp index 56f594a..11b575e 100644 --- a/libziparchive/unzip.cpp +++ b/libziparchive/unzip.cpp
@@ -448,6 +448,7 @@ static const struct option opts[] = { {"help", no_argument, 0, 'h'}, + {}, }; if (role == kUnzip) {