From: Bob Dalgleish Date: Mon, 26 Nov 2001 18:47:25 +0000 (-0600) Subject: [ID 20011126.148] Socket::inet_aton() incorrectly accepts null string X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=64e1b76789c0fb605467b2e39f8214801faef2f9;p=p5sagit%2Fp5-mst-13.2.git [ID 20011126.148] Socket::inet_aton() incorrectly accepts null string Message-Id: Craig Berry submitted half of this patch just yesterday. Spooky cosmic resonance. p4raw-id: //depot/perl@13291 --- diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 4191097..fb60dc2 100644 --- a/ext/Socket/Socket.xs +++ b/ext/Socket/Socket.xs @@ -222,7 +222,10 @@ inet_aton(host) { struct in_addr ip_address; struct hostent * phe; - int ok = inet_aton(host, &ip_address); + int ok = + (host != NULL) && + (*host != '\0') && + inet_aton(host, &ip_address); if (!ok && (phe = gethostbyname(host))) { Copy( phe->h_addr, &ip_address, phe->h_length, char );