[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fopen()-pclose() bug in install-info
From: |
Gavin Smith |
Subject: |
Re: fopen()-pclose() bug in install-info |
Date: |
Tue, 9 Feb 2021 17:11:22 +0000 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
On Fri, Jan 29, 2021 at 01:41:22PM +0100, Barath Aron wrote:
> Hello,
>
> I ran into a bug in the "install-info" program, where the "dir" file is
> opened with fopen(), and it was closed with pclose(). That's why
> "install-info" hangs on the OS I use.
> The path in the code is clear.
>
> install-info/install-info.c:
> 910: f = open_possibly_compressed_file (...)
> 700: f = fopen (*opened_filename, FOPEN_RBIN);
> # this might be executed, but won't make any difference
> 882: f = freopen (*opened_filename, "r", f);
> 888: return f;
> 939: pclose(f);
>
> I was able to get this work with the attached patch file, based on the
> comments and the code around it.
I didn't completely follow the problem and your fix. When exactly does
install-info hang and what OS do you use?
I think your fix stops pclose being called using the condition that
f != stdin in the readfile function but it doesn't look like the right
place for this.
Relevant commits in the git history are 2d03d088d9 and 3c795d1bcf
and this message
https://lists.gnu.org/archive/html/bug-texinfo/2015-02/msg00074.html
- Re: fopen()-pclose() bug in install-info,
Gavin Smith <=