bug-coreutils
[Top][All Lists]
Advanced

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

Re: [patch] uninitialized var in fold(1)


From: Jim Meyering
Subject: Re: [patch] uninitialized var in fold(1)
Date: Sat, 12 Apr 2003 01:22:24 +0200

Tim Waugh <address@hidden> wrote:
> It seems that line_out is used uninitialized in some circumstances in
> fold; this caused a segfault here.  Here's the fix (applies to 5.0
> too):
>
> --- coreutils-4.5.3/src/fold.c.init   2003-04-11 16:44:57.000000000 -0400
> +++ coreutils-4.5.3/src/fold.c        2003-04-11 16:44:46.000000000 -0400
> @@ -269,7 +269,7 @@
>    mbstate_t state, state_bak;        /* State of the stream. */
>    int convfail;              /* 1, when conversion is failed. Otherwise 0. */
>
> -  char *line_out;
> +  char *line_out = NULL;

Hi Tim,

Thanks for reporting that, but how do I reproduce the problem?

In any case, from the patch I see that this can't be a problem with
the GNU coreutils package.  The above patch cannot possibly apply to
coreutils-4.5.3 -- or even to any version of textutils released in the
last 10 years -- since the declaration of `line_out' is and always has
been like this:

  static char *line_out = NULL;

If there's a bug, then I suspect that it's due to some unofficial
changes.

Jim




reply via email to

[Prev in Thread] Current Thread [Next in Thread]