diff options
author | Chip Salzenberg <chip@perl.com> | 1996-12-20 10:11:20 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-04-25 00:00:00 +1200 |
commit | 0caed002bbf7ef75ea0a818a799f3c6a3d30f4e5 (patch) | |
tree | 5987157bc4fced689dffce4f91cbdc8fa679fffa /ext/Socket | |
parent | 67a5ea69d3c966769b43a1bc3e0013153ca25831 (diff) | |
download | perl-0caed002bbf7ef75ea0a818a799f3c6a3d30f4e5.tar.gz |
Don't core dump if my_inet_aton() get a NULL
Diffstat (limited to 'ext/Socket')
-rw-r--r-- | ext/Socket/Socket.xs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 7e3e3b375d..e3b282b0ad 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 ``.''. |