Просмотр исходного кода

Fix segfault in FindAny when /i is used, and there is n...
Author: doogie
Date: 2002-11-09 19:52:03 GMT
Fix segfault in FindAny when /i is used, and there is no default.

Arch Librarian лет назад: 22
Родитель
Сommit
cc99a10236
2 измененных файлов с 4 добавлено и 2 удалено
  1. 2 2
      apt-pkg/contrib/configuration.cc
  2. 2 0
      debian/changelog

+ 2 - 2
apt-pkg/contrib/configuration.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: configuration.cc,v 1.24 2002/11/09 17:11:25 doogie Exp $
+// $Id: configuration.cc,v 1.25 2002/11/09 19:52:03 doogie Exp $
 /* ######################################################################
 
    Configuration Class
@@ -282,7 +282,7 @@ string Configuration::FindAny(const char *Name,const char *Default) const
       case 'i': 
       {
 	 char buf[16];
-	 snprintf(buf, sizeof(buf)-1, "%d", FindI(key, atoi(Default)));
+	 snprintf(buf, sizeof(buf)-1, "%d", FindI(key, Default ? atoi(Default) : 0 ));
 	 return buf;
       }
    }

+ 2 - 0
debian/changelog

@@ -50,6 +50,8 @@ apt (0.5.5) unstable; urgency=low
   * Some highly unlikely memory faults. Closes: #155842
   * C++ stuff for G++3.2. Closes: #162617
   * apt-config dumps sends to stdout not stderr now.  Closes: #146294
+  * Fix segfault in FindAny when /i is used, and there is no default.
+    Closes: #165891
 
  -- Jason Gunthorpe <jgg@debian.org>  Sun, 15 Sep 2002 17:16:59 -0600