From: Adam Heath Date: Thu, 29 Aug 2002 19:39:07 +0000 (+0000) Subject: Fix corruption of available file, caused by use of memory that was X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e924fe5b76828f879084f3b7a9001b8c3ba2ff6;p=dpkg Fix corruption of available file, caused by use of memory that was previously freed. --- diff --git a/ChangeLog b/ChangeLog index 3bb5186f..3249eeee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Aug 29 14:42:05 CDT 2002 Adam Heath + + * 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 * lib/parse.c: Check for eof before we getc(), not after. diff --git a/debian/changelog b/debian/changelog index ae45f224..d7f44cfb 100644 --- a/debian/changelog +++ b/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 UNRELEASED diff --git a/lib/parsehelp.c b/lib/parsehelp.c index c7295024..0f13d7ac 100644 --- a/lib/parsehelp.c +++ b/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;