s3: parse_packet can return NULL which is then dereferenced in match_mailslot_name
authorTim Prouty <tprouty@samba.org>
Thu, 26 Mar 2009 18:28:37 +0000 (11:28 -0700)
committerKarolin Seeger <kseeger@samba.org>
Fri, 27 Mar 2009 12:06:56 +0000 (13:06 +0100)
(cherry picked from commit d097e3f918853cf642c4a51f6ed3a4d8c85d283e)

source/libsmb/unexpected.c

index df4d2119e27fceefa14d9d860c720031e5307e6e..4404b26ccb0514132400bfe482fe0e74b0f86570 100644 (file)
@@ -163,6 +163,10 @@ static int traverse_match(TDB_CONTEXT *ttdb, TDB_DATA kbuf, TDB_DATA dbuf,
                        ip,
                        port);
 
+       if (!p) {
+               return 0;
+       }
+
        if ((state->match_type == NMB_PACKET &&
             p->packet.nmb.header.name_trn_id == state->match_id) ||
            (state->match_type == DGRAM_PACKET &&