diff options
author | bohu <bohu@google.com> | 2017-08-01 23:30:03 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-08-01 23:30:03 +0000 |
commit | 0c7af6fa274abeed5172035d897c2afc43050463 (patch) | |
tree | 2de12b812b4833c5dd5e879f3c734ecb9cbecbd9 | |
parent | ca9256d857cdcae985ef8c7e78a1cb89e5d2dd54 (diff) | |
parent | ff3551bbd6d341e041d17249ba824d6204671c13 (diff) | |
download | gptfdisk-0c7af6fa274abeed5172035d897c2afc43050463.tar.gz |
gptfdisk: fix stack overflow in parsing cmdline am: 69e46b9a1c am: 8c834de12a
am: ff3551bbd6
Change-Id: I6678487f46848c2de3d77bf7a75ec67634c82921
-rw-r--r-- | android_popt.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/android_popt.cc b/android_popt.cc index a1492c6..b5b7970 100644 --- a/android_popt.cc +++ b/android_popt.cc @@ -98,7 +98,7 @@ int poptGetNextOpt(poptContext con) { #ifdef LOCAL_DEBUG fprintf(stderr, "getopt_long()=%c\n", res); #endif - if (res == 0 || res == '?') { + if (res <= 0 || res == '?' || i == -1) { return -1; } |