[PATCH] don't crash when missing /etc/protocols

Nickolai Zeldovich nickolai at cs.stanford.edu
Fri Apr 27 13:55:56 PDT 2007


This patch prevents a null pointer dereference when calling
getprotobyname() without an /etc/protocols in place.

Nickolai.

--- uclibc/libc/inet/getproto.c (revision 5067)
+++ uclibc/libc/inet/getproto.c (working copy)
@@ -195,7 +195,7 @@
     rv = 0;
 DONE:
     __UCLIBC_MUTEX_UNLOCK(mylock);
-    return 0;
+    return rv;
 }
 libc_hidden_def(getprotoent_r)


More information about the uClibc mailing list