r12370: - if we got a reply without a pending request, mark the socket as dead
authorStefan Metzmacher <metze@samba.org>
Mon, 19 Dec 2005 21:19:14 +0000 (21:19 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:47:31 +0000 (13:47 -0500)
  instead of segfaulting

metze

source/libcli/wrepl/winsrepl.c

index ead83768344c9b2525cbabcd1abd806b6940ec04..b67138f1dd24bd50bb234f8055f353bb5fde4e47 100644 (file)
@@ -84,6 +84,11 @@ static NTSTATUS wrepl_finish_recv(void *private, DATA_BLOB packet_blob_in)
        struct wrepl_request *req = wrepl_socket->recv_queue;
        DATA_BLOB blob;
 
+       if (!req) {
+               DEBUG(1,("Received unexpected WINS packet of length %u!\n", packet_blob_in.length));
+               return NT_STATUS_INVALID_NETWORK_RESPONSE;
+       }
+
        req->packet = talloc(req, struct wrepl_packet);
        NT_STATUS_HAVE_NO_MEMORY(req->packet);