Wireshark-commits: [Wireshark-commits] rev 35508: /trunk/epan/ /trunk/epan/: value_string.c value_s

Date: Wed, 12 Jan 2011 17:20:55 GMT
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=35508

User: morriss
Date: 2011/01/12 09:20 AM

Log:
 Fix the fuzz failure in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5574 :
 
 The first time a value_string_ext() is accessed, _match_strval_ext_init() is
 used before the real match function is called.  This function was not expanded
 to take an idx parameter (in rev 35451).  It compiled only because the function:
   a) previously did not match _value_string_match_t
   b) and the difference was being cast away when assigning _match_strval to it
      (So the fact that the index parameter was not added was also ignored.)
 
 To fix the problem, give _match_strval_ext_init() and index parameter and use
 it instead of a dummy variable when calling the real match function.  That way
 the first call to match_strval_ext_idx() will return an actual (initialized)
 index.
 
 To prevent the problem in the future, make the vse argument to
 _match_strval_ext_init() const *and then cast away the constness* so the
 function can modify the vse.

Directory: /trunk/epan/
  Changes    Path              Action
  +16 -8     value_string.c    Modified
  +2 -2      value_string.h    Modified