]> git.saurik.com Git - apt.git/commitdiff
* Avoid segfault if a package name is specified which c...
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 17:02:41 +0000 (17:02 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 17:02:41 +0000 (17:02 +0000)
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)

cmdline/apt-get.cc
debian/changelog

index 0ab1dc1d256f60d19e29c36f9dee44028a254234..0d32b9b39a7eda198b5e937793dd31346d455bc7 100644 (file)
@@ -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;
index da538197d41c1cadd7b634b6383c16434f37f0cf..031cad53a72003965ff8271dfb5974bb802e8ae1 100644 (file)
@@ -12,6 +12,9 @@ apt (0.5.9) unstable; urgency=low
     written by a single write(2)
   * Add new French man pages to doc/fr/.cvsignore
   * Add freebsd to buildlib/ostable (Closes: #193430)
+  * Avoid segfault if a package name is specified which consists
+    entirely of characters which look like end tags ('+', '-')
+    (Closes: #200425)
 
  --