Wireshark-dev: Re: [Wireshark-dev] [PATCH] some DCERPC fixes
From: "Stefan (metze) Metzmacher" <[email protected]>
Date: Sat, 25 Nov 2006 09:21:45 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jaap,

thanks! I have a little additional patch,
that makes it easier to see what which bytes
are not caught by the sub_dissector.

And it makes it easy to select and export the full payload to
a file.

metze
>Hi,
>
>Checked in.
>
>Thanx,
>Jaap

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFFZ/0Ym70gjA5TCD8RAqCIAJwLx8D/eSU5IrrxTsUu7HruJn5ZqACfbVS2
uOW2m1iqWCkvGcrssOMXO38=
=uHaY
-----END PGP SIGNATURE-----
Index: epan/dissectors/packet-dcerpc.c
===================================================================
--- epan/dissectors/packet-dcerpc.c	(Revision 19978)
+++ epan/dissectors/packet-dcerpc.c	(Arbeitskopie)
@@ -2295,19 +2295,26 @@
                  * dissect; just re-throw that exception.
                  */
                 TRY {
+                    int remaining;
+
                     offset = sub_dissect (stub_tvb, 0, pinfo, sub_tree,
                                           drep);
-                    if(tree && offset > 0) {
-                        proto_item_set_len(sub_item, offset);
-                    }
 
                     /* If we have a subdissector and it didn't dissect all
                        data in the tvb, make a note of it. */
-                    if (tvb_reported_length_remaining(stub_tvb, offset) > 0) {
+                    remaining = tvb_reported_length_remaining(stub_tvb, offset);
+                    if (remaining > 0) {
+                        proto_tree_add_text(sub_tree, stub_tvb, offset,
+                                            remaining,
+                                            "[Long frame (%d byte%s)]",
+                                            remaining,
+                                            plurality(remaining, "", "s"));
                         if (check_col(pinfo->cinfo, COL_INFO))
                             col_append_fstr(pinfo->cinfo, COL_INFO,
-                                            "[Long frame (%d bytes)]",
-                                            tvb_reported_length_remaining(stub_tvb, offset));
+                                            "[Long frame (%d byte%s)]",
+                                            remaining,
+                                            plurality(remaining, "", "s"));
+
                     }
                 } CATCH(BoundsError) {
                     RETHROW;

Attachment: dcerpc-fix-02.diff.sig
Description: PGP signature