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

Fix corruption of available file, caused by use of memory that was
previously freed.

Adam Heath лет назад: 24
Родитель
Сommit
0e924fe5b7
3 измененных файлов с 8 добавлено и 3 удалено
  1. 5 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 1 3
      lib/parsehelp.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+Thu Aug 29 14:42:05 CDT 2002 Adam Heath <doogie@debian.org>
+
+  * lib/parsehelp.c: Fix corruption of available file, caused by use of
+    memory that was previously freed.
+
 Thu Aug 29 14:31:22 CDT 2002 Adam Heath <doogie@debian.org>
 
   * lib/parse.c: Check for eof before we getc(), not after.

+ 2 - 0
debian/changelog

@@ -17,6 +17,8 @@ dpkg (1.10.5) unstable; urgency=low
     version does not do this, as it reformats the options, and thereby
     only takes the first line.  So, we now split all the lines from the
     stanza, and process them all.  Closes: #147492.
+  * Fix corruption of available file, caused by use of memory that was
+    previously freed.  Closes: #154257.
 
  -- Adam Heath <doogie@debian.org>  UNRELEASED
 

+ 1 - 3
lib/parsehelp.c

@@ -228,9 +228,7 @@ void parsemustfield
  const struct pkginfo *pigp, int warnonly,
  const char **value, const char *what) 
 {
-  static char *empty = NULL;
-  if (!empty)
-    empty= nfstrsave("");
+  static const char *empty = "";
   if (!*value) {
     parseerr(file,filename,lno, warnto,warncount,pigp,warnonly, _("missing %s"),what);
     *value= empty;