Re: [Tinycc-devel] NULL pointer dereference due to unchecked return from fdopen()

2022-02-28 Thread Steffen Nurpmeso
Steffen Nurpmeso wrote in <20220228202318.dh447%stef...@sdaoden.eu>: |Domingo Alvarez Duarte wrote in | <0154ffd1-bddf-9093-038a-b8286f92d...@gmail.com>: ||+1 To "just write a tcc_fdopen()" | |Looking into it i thought adding two missing checks is sufficient. |Untested. | | https://repo.o

Re: [Tinycc-devel] NULL pointer dereference due to unchecked return from fdopen()

2022-02-28 Thread Steffen Nurpmeso
Domingo Alvarez Duarte wrote in <0154ffd1-bddf-9093-038a-b8286f92d...@gmail.com>: |+1 To "just write a tcc_fdopen()" Looking into it i thought adding two missing checks is sufficient. Untested. https://repo.or.cz/tinycc.git/commitdiff/917aad3bcfbb534875aa6d66609bdb36459460a4 --steffen | |De

Re: [Tinycc-devel] NULL pointer dereference due to unchecked return from fdopen()

2022-02-28 Thread Domingo Alvarez Duarte
+1 To "just write a tcc_fdopen()" On 28/2/22 13:46, Steffen Nurpmeso wrote: Vincent Lefevre wrote in <20220228103710.ga33...@zira.vinc17.org>: |On 2022-02-28 10:50:29 +0100, grischka wrote: |> Christian Jullien wrote: |>> Thanks, |>> This is unfortunately not the only case where return

Re: [Tinycc-devel] NULL pointer dereference due to unchecked return from fdopen()

2022-02-28 Thread Steffen Nurpmeso
Vincent Lefevre wrote in <20220228103710.ga33...@zira.vinc17.org>: |On 2022-02-28 10:50:29 +0100, grischka wrote: |> Christian Jullien wrote: |>> Thanks, |>> This is unfortunately not the only case where returned value is \ |>> not tested, just for fdopen, if maintainers agree, we can probabl

Re: [Tinycc-devel] NULL pointer dereference due to unchecked return from fdopen()

2022-02-28 Thread Vincent Lefevre
On 2022-02-28 10:50:29 +0100, grischka wrote: > Christian Jullien wrote: > > Thanks, > > This is unfortunately not the only case where returned value is not tested, > > just for fdopen, if maintainers agree, we can probably apply: > > Wdyt? > > The rule is, as always: don't write code that you c

Re: [Tinycc-devel] NULL pointer dereference due to unchecked return from fdopen()

2022-02-28 Thread Christian Jullien
ay, February 28, 2022 10:50 To: jull...@eligis.com; tinycc-devel@nongnu.org Subject: Re: [Tinycc-devel] NULL pointer dereference due to unchecked return from fdopen() Christian Jullien wrote: > Thanks, > This is unfortunately not the only case where returned value is not tested, > just fo

Re: [Tinycc-devel] NULL pointer dereference due to unchecked return from fdopen()

2022-02-28 Thread grischka
ename); +} if (s1->verbose) printf("<- %s\n", filename); -Original Message- From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of John Scott Sent: Monday, February 28, 2022 05:18 To: tinycc-devel@nongnu.org Subject: [Tinycc-d

Re: [Tinycc-devel] NULL pointer dereference due to unchecked return from fdopen()

2022-02-27 Thread Christian Jullien
28, 2022 05:18 To: tinycc-devel@nongnu.org Subject: [Tinycc-devel] NULL pointer dereference due to unchecked return from fdopen() Hi all, I found this bug using the oomify tool at https://github.com/tavianator/oomify The problem can be seen at tccelf.c around line 2430 (f has type FILE*):

[Tinycc-devel] NULL pointer dereference due to unchecked return from fdopen()

2022-02-27 Thread John Scott
Hi all, I found this bug using the oomify tool at https://github.com/tavianator/oomify The problem can be seen at tccelf.c around line 2430 (f has type FILE*): f = fdopen(fd, "wb"); if (s1->verbose) printf("<- %s\n", filename); #ifdef TCC_TARGET_COFF if (s