diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2012-06-09 22:55:51 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2012-06-09 22:55:51 +0200 |
commit | 7a6d9076595b2acc164d6f057f609c96c359ea08 (patch) | |
tree | f3fdc21c3e5891cad360220c136d714b1af0b88f /apt-pkg/contrib | |
parent | ae2be086c6996e6ed02b7d828fdcac38248a964d (diff) |
fix segfault with empty LongOpt in --no-* branch
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r-- | apt-pkg/contrib/cmndline.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc index b8c7f7984..75d02cad4 100644 --- a/apt-pkg/contrib/cmndline.cc +++ b/apt-pkg/contrib/cmndline.cc @@ -106,7 +106,8 @@ bool CommandLine::Parse(int argc,const char **argv) Opt++; for (A = ArgList; A->end() == false && - stringcasecmp(Opt,OptEnd,A->LongOpt) != 0; A++); + (A->LongOpt == 0 || stringcasecmp(Opt,OptEnd,A->LongOpt) != 0); + ++A); // Failed again.. if (A->end() == true && OptEnd - Opt != 1) |