mirror of
				https://sourceware.org/git/glibc.git
				synced 2025-11-03 20:53:13 +03:00 
			
		
		
		
	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 <fberat@redhat.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
		
			
				
	
	
		
			31 lines
		
	
	
		
			985 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			985 B
		
	
	
	
		
			C
		
	
	
	
	
	
#ifndef _ARPA_INET_H
 | 
						|
/* Note: _ARPA_INET_H is defined by inet/arpa/inet.h below.  */
 | 
						|
#include <inet/arpa/inet.h>
 | 
						|
 | 
						|
#ifndef _ISOMAC
 | 
						|
/* Declare functions with security checks.
 | 
						|
   This needs to be included unconditionally as these definition are needed even
 | 
						|
   when fortification is disabled in inet/arpa/inet.h.  */
 | 
						|
#include <bits/inet-fortified-decl.h>
 | 
						|
 | 
						|
/* Variant of inet_aton which rejects trailing garbage.  */
 | 
						|
extern int __inet_aton_exact (const char *__cp, struct in_addr *__inp);
 | 
						|
libc_hidden_proto (__inet_aton_exact)
 | 
						|
 | 
						|
extern __typeof (inet_ntop) __inet_ntop;
 | 
						|
libc_hidden_proto (__inet_ntop)
 | 
						|
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)
 | 
						|
extern __typeof (inet_network) __inet_network;
 | 
						|
libc_hidden_proto (__inet_network)
 | 
						|
#endif
 | 
						|
#endif
 |