mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 14:26:03 -04:00
libcasper: Neuter false positive -Wuse-after-free warnings from GCC 13
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
This commit is contained in:
parent
b50261e21f
commit
b7f7cc25c0
3 changed files with 9 additions and 0 deletions
|
|
@ -40,3 +40,6 @@ 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}
|
||||
|
|
|
|||
|
|
@ -29,3 +29,6 @@ MLINKS+=cap_netdb.3 libcap_netdb.3
|
|||
MLINKS+=cap_netdb.3 cap_getprotobyname.3
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
|
||||
# GCC 13 complains incorrectly about free after failed realloc: GCC bug #110501
|
||||
CFLAGS.cap_netdb.c+= ${NO_WUSE_AFTER_FREE}
|
||||
|
|
|
|||
|
|
@ -40,3 +40,6 @@ MLINKS+=cap_pwd.3 cap_pwd_limit_fields.3
|
|||
MLINKS+=cap_pwd.3 cap_pwd_limit_users.3
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
|
||||
# GCC 13 complains incorrectly about free after failed realloc: GCC bug #110501
|
||||
CFLAGS.cap_pwd.c+= ${NO_WUSE_AFTER_FREE}
|
||||
|
|
|
|||
Loading…
Reference in a new issue