summaryrefslogtreecommitdiff
path: root/libc/inet/addr.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/inet/addr.c')
-rw-r--r--libc/inet/addr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/inet/addr.c b/libc/inet/addr.c
index ba2a022d6..94fa3aab7 100644
--- a/libc/inet/addr.c
+++ b/libc/inet/addr.c
@@ -55,6 +55,10 @@ int inet_aton(const char *cp, struct in_addr *addrptr)
int value;
int part;
+ if (cp == NULL) { /* check for NULL arg */
+ return 0;
+ }
+
addr = 0;
for (part = 1; part <= 4; part++) {