]> Savannah Git Hosting - gnulib.git/commit
fts: pacify GCC 13 -Wuse-after-free
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 4 Feb 2023 18:07:11 +0000 (10:07 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 4 Feb 2023 18:14:12 +0000 (10:14 -0800)
commit6d488119c68989038faa05c9ee9d43c8c82487e4
tree60493da32f5ac7007870c7b7a88b3d011479cfa8
parent4e9fcc7b84fcac07a3e5a3cd5f66d1ff320dc8e8
fts: pacify GCC 13 -Wuse-after-free

Problem reported by Peter Frazier in:
https://lists.gnu.org/r/bug-gnulib/2023-02/msg00000.html
* lib/fts.c: Include stdint.h.
(fts_build): Do not access freed pointer directly; instead,
save its bit-pattern into a uintptr_t, and use that to compare.
(ADJUST): Likewise, but more trickily since this hack
puns pointer types and relies on undefined behavior.
* modules/fts (Depends-on): Add stdint.
ChangeLog
lib/fts.c
modules/fts