Wireshark

  • Riverbed Technology
  • WinPcap
the world's foremost network protocol analyzer
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-users: [Wireshark-users] [patch] error in ProtoField lua code prevents mask being specified with valuestring table

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: Sam Roberts <vieuxtech@xxxxxxxxx>
Date: Wed, 3 Jun 2009 15:01:18 -0700

The underlying cause is that value_string_from_table()'s use of the
lua stack is not balanced, if a table is iterated, it pops one more
time than it should.

The user-visible effect is that code such as:

  ProtoField.uint8( "wihart.addrspec.dst64", "dst64", base.HEX,
{[0x40]="yes", [0x0]="no"}, 0x40)

will always set the mask to 0, because the the mask is popped when the
value/string table is processed.

I did a (very) quick grep, and didn't see this bug in the other places
lua_next() is called, but it might be worth reviewing further.

Index: epan/wslua/wslua_proto.c
===================================================================
--- epan/wslua/wslua_proto.c    (revision 28617)
+++ epan/wslua/wslua_proto.c    (working copy)
@@ -516,7 +516,7 @@
         lua_pop(L, 1);
     }

-    lua_pop(L, 1);
+/*  lua_pop(L, 1); */

     ret = (value_string*)vs->data;

  • Follow-Ups:
    • Re: [Wireshark-users] [patch] error in ProtoField lua code prevents mask being specified with valuestring table
      • From: Stig Bjørlykke
  • Prev by Date: Re: [Wireshark-users] Wireshark for A and Abis message decoding
  • Next by Date: Re: [Wireshark-users] [patch] error in ProtoField lua code prevents mask being specified with valuestring table
  • Previous by thread: Re: [Wireshark-users] 2dparityfec dissector
  • Next by thread: Re: [Wireshark-users] [patch] error in ProtoField lua code prevents mask being specified with valuestring table
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation