From Yaniv Kaul via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5372 :
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 6 Dec 2010 15:57:39 +0000 (15:57 +0000)
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 6 Dec 2010 15:57:39 +0000 (15:57 +0000)
Fix crash in LDAP dissector, in a generic way (for all callers of
dissect_nt_sid()).

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35127 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-windows-common.c

index 2f6acc15e3db70f2b0ae33fd525257bb877fa40e..121b3adac6ad095a462a15f00dae9f2159c1dc03 100644 (file)
@@ -1504,14 +1504,14 @@ dissect_nt_sid(tvbuff_t *tvb, int offset, proto_tree *parent_tree,
        na_offset = offset;
        offset++;
 
-       /* if no tree, just return the offset of the end_of_SID+1 */
-       if (!parent_tree)
-               return(offset+=(6+(num_auth*4)));
-
        if(sid_str)
                *sid_str=NULL;
 
        if(hf_sid==-1){
+       /* if no tree, just return the offset of the end_of_SID+1 */
+       if (!parent_tree)
+               return(offset+=(6+(num_auth*4)));
+
                hf_sid=hf_nt_sid;
        }