[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#154257: Patch to fix #154257



On Wed, 28 Aug 2002, Zephaniah E. Hull wrote:

> diff -ur dpkg-1.10.4/lib/parsehelp.c dpkg-1.10.4.new/lib/parsehelp.c
> --- dpkg-1.10.4/lib/parsehelp.c	2002-05-06 12:18:15.000000000 -0400
> +++ dpkg-1.10.4/lib/parsehelp.c	2002-08-28 07:10:00.000000000 -0400
> @@ -228,12 +228,9 @@
>   const struct pkginfo *pigp, int warnonly,
>   const char **value, const char *what)
>  {
> -  static char *empty = NULL;
> -  if (!empty)
> -    empty= nfstrsave("");
>    if (!*value) {
>      parseerr(file,filename,lno, warnto,warncount,pigp,warnonly, _("missing %s"),what);
> -    *value= empty;
> +    *value= nfstrsave("");
>    } else if (!**value) {
>      parseerr(file,filename,lno, warnto,warncount,pigp,warnonly,
>               _("empty value for %s"),what);


The correct fix, and still keeping the memory savings, is to not use nfstrsave
at all, but have a static const char empty = ""; outside of the function.
This is what I haev locally.

I'm glad you have figured out that this is what is corrupting available files.




Reply to: