Pārlūkot izejas kodu

Fix crash when a .deb file becomes unreadable while dpkg is starting

Closes: #386210
Ian Jackson 18 gadi atpakaļ
vecāks
revīzija
402e247056
3 mainītis faili ar 9 papildinājumiem un 0 dzēšanām
  1. 5 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 2 0
      lib/tarfn.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-03-20  Ian Jackson  <ian@davenant.greenend.org.uk>
+
+	* lib/tarfn.c (TarExtractor): Initialize h.LinkName and h.Name to
+	NULL.
+
 2008-03-16  Raphael Hertzog  <hertzog@debian.org>
 
 	* scripts/Dpkg/Shlibs/Objdump.pm: Add "objid" property to

+ 2 - 0
debian/changelog

@@ -27,6 +27,8 @@ dpkg (1.14.17) UNRELEASED; urgency=low
     Thanks to Ian Jackson.
   * Allow compilation with --disable-nls on systems without libintl.h where
     a non glibc claims to be glibc. Closes: #465420
+  * Fix crash when a .deb file becomes unreadable while dpkg is starting.
+    Thanks to Ian Jackson. Closes: #386210
 
   [ Raphael Hertzog ]
   * Add a warning displayed by dpkg-genchanges if the current version is

+ 2 - 0
lib/tarfn.c

@@ -140,6 +140,8 @@ TarExtractor(
 	symListBottom = symListPointer = symListTop = m_malloc(sizeof(symlinkList));
 	symListTop->next = NULL;
 
+	h.Name = NULL;
+	h.LinkName = NULL;
 	h.UserData = userData;
 
 	while ( (status = functions->Read(userData, buffer, 512)) == 512 ) {