* Re: master 370a386633b 1/4: Pacify -Wanalyzer-null-dereference in sfnt.c
[not found] ` <20240519155826.EE3D5C3534D@vcs2.savannah.gnu.org>
@ 2024-05-20 1:09 ` Po Lu
2024-05-20 1:27 ` Paul Eggert
0 siblings, 1 reply; 3+ messages in thread
From: Po Lu @ 2024-05-20 1:09 UTC (permalink / raw)
To: emacs-devel; +Cc: Paul Eggert
Paul Eggert <eggert@cs.ucla.edu> writes:
> The change to sfnt_read_cvar_table fixes what appears to be
> an actual null-dereference bug.
I'm curious as to how you reached this conclusion. In this branch:
if (points && npoints != UINT16_MAX)
{
if (cvar->variation[i].num_points > cvt->num_elements)
cvar->variation[i].num_points = cvt->num_elements;
cvar->variation[i].points = (uint16_t *) coords;
for (j = 0; j < cvar->variation[i].num_points; ++j)
*coords++ = points[j];
}
cvt->variation[i].num_points is set to npoints and never increased
beyond it, so that `points' is not indexed if it is zero.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: master 370a386633b 1/4: Pacify -Wanalyzer-null-dereference in sfnt.c
2024-05-20 1:09 ` master 370a386633b 1/4: Pacify -Wanalyzer-null-dereference in sfnt.c Po Lu
@ 2024-05-20 1:27 ` Paul Eggert
2024-05-20 6:26 ` Po Lu
0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2024-05-20 1:27 UTC (permalink / raw)
To: Po Lu, emacs-devel
On 2024-05-19 18:09, Po Lu wrote:
> I'm curious as to how you reached this conclusion.
Oh, in rereading it I think you're right, the code was fine before the
change and GCC was issuing a false positive. (The code's also fine now
and GCC is happy...) Sorry about the noise.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: master 370a386633b 1/4: Pacify -Wanalyzer-null-dereference in sfnt.c
2024-05-20 1:27 ` Paul Eggert
@ 2024-05-20 6:26 ` Po Lu
0 siblings, 0 replies; 3+ messages in thread
From: Po Lu @ 2024-05-20 6:26 UTC (permalink / raw)
To: Paul Eggert; +Cc: emacs-devel
Paul Eggert <eggert@cs.ucla.edu> writes:
> Oh, in rereading it I think you're right, the code was fine before the
> change and GCC was issuing a false positive. (The code's also fine now
> and GCC is happy...) Sorry about the noise.
No worries, and thanks for the additional scrutiny, off the mark though
it was in this instance.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-20 6:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <171613430645.14650.14769510281099549912@vcs2.savannah.gnu.org>
[not found] ` <20240519155826.EE3D5C3534D@vcs2.savannah.gnu.org>
2024-05-20 1:09 ` master 370a386633b 1/4: Pacify -Wanalyzer-null-dereference in sfnt.c Po Lu
2024-05-20 1:27 ` Paul Eggert
2024-05-20 6:26 ` Po Lu
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.