From e3a6e85d67f1a48dec3e2557a83d6ce1544a58cb Mon Sep 17 00:00:00 2001 From: Aaron Merey Date: Thu, 20 Mar 2025 13:13:33 -0400 Subject: Add _FORTIFY_SOURCE support for inet_pton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add function __inet_pton_chk which calls __chk_fail when the size of argument dst is too small. inet_pton is redirected to __inet_pton_chk or __inet_pton_warn when _FORTIFY_SOURCE is > 0. Also add tests to debug/tst-fortify.c, update the abilist with __inet_pton_chk and mention inet_pton fortification in maint.texi. Co-authored-by: Frédéric Bérat Reviewed-by: Florian Weimer --- include/arpa/inet.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/arpa/inet.h b/include/arpa/inet.h index a02892f48a..3db8f1a96f 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -19,6 +19,8 @@ libc_hidden_proto (__inet_ntop_chk) libc_hidden_proto (inet_pton) extern __typeof (inet_pton) __inet_pton; libc_hidden_proto (__inet_pton) +libc_hidden_proto (__inet_pton_chk) + extern __typeof (inet_makeaddr) __inet_makeaddr; libc_hidden_proto (__inet_makeaddr) libc_hidden_proto (inet_netof) -- cgit v1.2.3