瀏覽代碼

fix double free (closes: #711045)

Michael Vogt 13 年之前
父節點
當前提交
e3b402f403
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 5 2
      apt-pkg/contrib/fileutl.cc
  2. 3 0
      debian/changelog

+ 5 - 2
apt-pkg/contrib/fileutl.cc

@@ -1424,8 +1424,11 @@ bool FileFd::Seek(unsigned long long To)
 	 return _error->Error("Reopen is only implemented for read-only files!");
 	 return _error->Error("Reopen is only implemented for read-only files!");
       }
       }
 #ifdef HAVE_BZ2
 #ifdef HAVE_BZ2
-      if (d->bz2 != NULL)
-	 BZ2_bzclose(d->bz2);
+     if (d->bz2 != NULL) 
+     {
+	BZ2_bzclose(d->bz2);
+	d->bz2 = NULL;
+     }
 #endif
 #endif
       if (iFd != -1)
       if (iFd != -1)
 	 close(iFd);
 	 close(iFd);

+ 3 - 0
debian/changelog

@@ -9,6 +9,9 @@ apt (0.9.8.2) UNRELEASED; urgency=low
   [ Michael Vogt ]
   [ Michael Vogt ]
   * buildlib/apti18n.h.in:
   * buildlib/apti18n.h.in:
     - fix build failure when building without NLS (closes: #671587)
     - fix build failure when building without NLS (closes: #671587)
+  
+  [ Gregoire Menuel ]
+  * fix double free (closes: #711045)
 
 
  -- Christian Perrier <bubulle@debian.org>  Thu, 16 May 2013 22:28:22 +0200
  -- Christian Perrier <bubulle@debian.org>  Thu, 16 May 2013 22:28:22 +0200