libwbclient: Add some input check
authorVolker Lendecke <vl@samba.org>
Wed, 9 Mar 2011 09:58:47 +0000 (10:58 +0100)
committerVolker Lendecke <vlendec@samba.org>
Thu, 10 Mar 2011 10:10:30 +0000 (11:10 +0100)
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Mar 10 11:10:30 CET 2011 on sn-devel-104

nsswitch/wb_common.c

index 2a1795c33bdb251b40068e5890b32073fd3e200b..dcfc8a5156886e63cacd1b103f466ebc7e34833a 100644 (file)
@@ -514,6 +514,10 @@ static int winbindd_read_reply(struct winbindd_response *response)
                return -1;
        }
 
+       if (response->length < sizeof(struct winbindd_response)) {
+               return -1;
+       }
+
        /* We actually send the pointer value of the extra_data field from
           the server.  This has no meaning in the client's address space
           so we clear it out. */