From: Chip Salzenberg Date: Thu, 19 Dec 1996 22:11:20 +0000 (+1200) Subject: Don't core dump if my_inet_aton() get a NULL X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0caed002bbf7ef75ea0a818a799f3c6a3d30f4e5;p=p5sagit%2Fp5-mst-13.2.git Don't core dump if my_inet_aton() get a NULL --- diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 7e3e3b3..e3b282b 100644 --- a/ext/Socket/Socket.xs +++ b/ext/Socket/Socket.xs @@ -51,7 +51,7 @@ my_inet_aton(cp, addr) register const char *cp; struct in_addr *addr; { - register unsigned long val; + register U32 val; register int base; register char c; int nparts; @@ -59,6 +59,8 @@ struct in_addr *addr; unsigned int parts[4]; register unsigned int *pp = parts; + if (!cp) + return 0; for (;;) { /* * Collect number up to ``.''.