[PATCH 3/4] Do not dereference null pointer. (LLVM/Clang)

Lauri Kenttä lauri.kentta at gmail.com
Fri Jun 10 15:38:39 CDT 2011


---
 dlls/ws2_32/tests/sock.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 4697ade..bc030de 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -1573,6 +1573,7 @@ static DWORD WINAPI do_getservbyname( void *param )
         for ( j = 0; j < 2; j++ ) {
             pserv[j] = getservbyname ( serv[j].name, serv[j].proto );
             ok ( pserv[j] != NULL, "getservbyname could not retrieve information for %s: %d\n", serv[j].name, WSAGetLastError() );
+            if ( pserv[j] == NULL ) continue;
             ok ( pserv[j]->s_port == htons(serv[j].port), "getservbyname returned the wrong port for %s: %d\n", serv[j].name, ntohs(pserv[j]->s_port) );
             ok ( !strcmp ( pserv[j]->s_proto, serv[j].proto ), "getservbyname returned the wrong protocol for %s: %s\n", serv[j].name, pserv[j]->s_proto );
             ok ( !strcmp ( pserv[j]->s_name, serv[j].name ), "getservbyname returned the wrong name for %s: %s\n", serv[j].name, pserv[j]->s_name );
-- 
1.7.5.2




More information about the wine-patches mailing list