bug-texinfo
[Top][All Lists]
Advanced

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

Re: Texinfo 7.0.93 pretest available


From: Eli Zaretskii
Subject: Re: Texinfo 7.0.93 pretest available
Date: Sun, 08 Oct 2023 16:38:46 +0300

> From: Gavin Smith <gavinsmith0123@gmail.com>
> Date: Sun, 8 Oct 2023 12:50:51 +0100
> Cc: bug-texinfo@gnu.org
> 
> On Sun, Oct 08, 2023 at 02:39:36PM +0300, Eli Zaretskii wrote:
> > Sorry, I was mistaken: the Gnulib getdelim is not used here.  Instead,
> > this build uses the MinGW implementation of getdelim, and that one has
> > a subtle bug, which rears its ugly head because the second argument to
> > getline, here:
> > 
> >           status = getline (&line, &n, input_file);
> > 
> > is not initialized to any value.  The simple fix below avoids the
> > crash and allows the build to run to completion:
> 
> (I'd noticed that and checked the Gnulib implementation didn't need n
> to be defined if the first argument was null.)
> 
> According to the documentation for getline,
> 
>      If you set ‘*LINEPTR’ to a null pointer, and ‘*N’ to zero, before
>      the call, then ‘getline’ allocates the initial buffer for you by
>      calling ‘malloc’.  This buffer remains allocated even if ‘getline’
>      encounters errors and is unable to read any bytes.
> 
> Hence, I propose to initialise n to 0, rather than 120 as in the patch
> below.

No, the value must be positive, otherwise it still crashes.  It's a
bug in MinGW implementation.



reply via email to

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