ソースを参照

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

Adam Heath 24 年 前
コミット
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>
 Thu Aug 29 14:31:22 CDT 2002 Adam Heath <doogie@debian.org>
 
 
   * lib/parse.c: Check for eof before we getc(), not after.
   * 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
     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
     only takes the first line.  So, we now split all the lines from the
     stanza, and process them all.  Closes: #147492.
     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
  -- Adam Heath <doogie@debian.org>  UNRELEASED
 
 

+ 1 - 3
lib/parsehelp.c

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