summaryrefslogtreecommitdiff
path: root/libc/inet/addr.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2007-02-02 01:29:10 +0000
committerEric Andersen <andersen@codepoet.org>2007-02-02 01:29:10 +0000
commit83b530eb6b7111486156fc5286a7f40742aeb2d0 (patch)
tree7aab0c2f107cbda453942a89f1a8eaed5a3ed48f /libc/inet/addr.c
parentf21e442f635260e070527637c04574a4fe95fb4b (diff)
Ronald Maeder writes:
I have successfully made gethostbyname_r(), res_init(), and gethostid() fully reentrant. In addition, I have added a NULL check to inet_aton(). This is where SEG FAULTs were coming from when gethostbyname_r() was called.
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++) {