Check for null pointers passed to inet_addr
authorGed Murphy <gedmurphy@reactos.org>
Mon, 1 Sep 2008 08:00:22 +0000 (08:00 +0000)
committerGed Murphy <gedmurphy@reactos.org>
Mon, 1 Sep 2008 08:00:22 +0000 (08:00 +0000)
See issue #3695 for more details.

svn path=/trunk/; revision=35851

reactos/dll/win32/ws2_32/misc/ns.c

index 1db254d..b95b2af 100644 (file)
@@ -1298,6 +1298,12 @@ inet_addr(IN  CONST CHAR FAR* cp)
 
     p = (PCHAR)cp;
 
+    if (!p)
+    {
+        WSASetLastError(WSAEFAULT);
+        return INADDR_NONE;
+    }
+
     if (strlen(p) == 0)
         return INADDR_NONE;