[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lynx-dev] Fixing some warnings.
From: |
Thorsten Glaser |
Subject: |
Re: [Lynx-dev] Fixing some warnings. |
Date: |
Mon, 5 Jun 2017 23:11:51 +0000 (UTC) |
Juan Manuel Guerrero dixit:
> - if (me->object_title == '\0') {
> + if (*me->object_title == '\0') {
> FREE(me->object_title);
I think a NULL pointer comparison was intended here, and that
this patch may introduce use-after-free bugs.
However, why FREE() doesn’t accept null pointers in the first
place is questionable. (And if free() is macro-wrapped already,
it should probably assign NULL to the variable afterwards, just
to be safe.)
bye,
//mirabilos
--
In traditional syntax ' is ignored, but in c99 everything between two ' is
handled as character constant. Therefore you cannot use ' in a preproces-
sing file in c99 mode. -- Ragge
No faith left in ISO C99, undefined behaviour, etc.