diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 17:02:41 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 17:02:41 +0000 |
commit | 418af5d2e7095f597d4d52e33d9504c82f865b41 (patch) | |
tree | 45d7252187979742a22d8f0c1c7b7751c42ced8f /cmdline/apt-get.cc | |
parent | a2a43337c966feb5094e2d1b9c5f1770577d4fde (diff) |
* Avoid segfault if a package name is specified which c...
Author: mdz
Date: 2003-08-07 20:51:50 GMT
* Avoid segfault if a package name is specified which consists
entirely of characters which look like end tags ('+', '-')
(Closes: #200425)
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r-- | cmdline/apt-get.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 0ab1dc1d2..0d32b9b39 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: apt-get.cc,v 1.133 2003/07/25 22:03:49 mdz Exp $ +// $Id: apt-get.cc,v 1.134 2003/08/07 20:51:50 mdz Exp $ /* ###################################################################### apt-get - Cover for dpkg @@ -1350,14 +1350,14 @@ bool DoInstall(CommandLine &CmdL) while (Cache->FindPkg(S).end() == true) { // Handle an optional end tag indicating what to do - if (S[Length - 1] == '-') + if (Length >= 1 && S[Length - 1] == '-') { Remove = true; S[--Length] = 0; continue; } - if (S[Length - 1] == '+') + if (Length >= 1 && S[Length - 1] == '+') { Remove = false; S[--Length] = 0; |