mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
GCC 13 incorrectly thinks a call to free after a failed realloc is a
use after free.
lib/libcasper/services/cap_grp/cap_grp.c: In function 'group_resize':
lib/libcasper/services/cap_grp/cap_grp.c:65:17: error: pointer 'buf' may be used after 'realloc' [-Werror=use-after-free]
65 | free(buf);
| ^~~~~~~~~
lib/libcasper/services/cap_grp/cap_grp.c:63:19: note: call to 'realloc' here
63 | gbuffer = realloc(buf, gbufsize);
| ^~~~~~~~~~~~~~~~~~~~~~
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D42576
(cherry picked from commit b7f7cc25c01aeacaafb86ebcffdeb258b7933b08)
45 lines
882 B
Makefile
45 lines
882 B
Makefile
|
|
SHLIBDIR?= /lib
|
|
|
|
.include <src.opts.mk>
|
|
|
|
PACKAGE= runtime
|
|
|
|
SHLIB_MAJOR= 1
|
|
INCSDIR?= ${INCLUDEDIR}/casper
|
|
|
|
.if ${MK_CASPER} != "no"
|
|
SHLIB= cap_grp
|
|
|
|
SRCS= cap_grp.c
|
|
.endif
|
|
|
|
INCS= cap_grp.h
|
|
|
|
LIBADD= nv
|
|
|
|
CFLAGS+=-I${.CURDIR}
|
|
|
|
HAS_TESTS=
|
|
SUBDIR.${MK_TESTS}+= tests
|
|
|
|
MAN+= cap_grp.3
|
|
|
|
MLINKS+=cap_grp.3 libcap_grp.3
|
|
MLINKS+=cap_grp.3 cap_getgrent.3
|
|
MLINKS+=cap_grp.3 cap_getgrnam.3
|
|
MLINKS+=cap_grp.3 cap_getgrgid.3
|
|
MLINKS+=cap_grp.3 cap_getgrent_r.3
|
|
MLINKS+=cap_grp.3 cap_getgrnam_r.3
|
|
MLINKS+=cap_grp.3 cap_getgrgid_r.3
|
|
MLINKS+=cap_grp.3 cap_setgroupent.3
|
|
MLINKS+=cap_grp.3 cap_setgrent.3
|
|
MLINKS+=cap_grp.3 cap_endgrent.3
|
|
MLINKS+=cap_grp.3 cap_grp_limit_cmds.3
|
|
MLINKS+=cap_grp.3 cap_grp_limit_fields.3
|
|
MLINKS+=cap_grp.3 cap_grp_limit_groups.3
|
|
|
|
.include <bsd.lib.mk>
|
|
|
|
# GCC 13 complains incorrectly about free after failed realloc: GCC bug #110501
|
|
CFLAGS.cap_grp.c+= ${NO_WUSE_AFTER_FREE}
|