Ethereal-dev: [Ethereal-dev] [PATCH] WSP parsing of x-wap.tod encoded as text

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Loïc Minier <lool@xxxxxxxxxx>
Date: Fri, 25 Jul 2003 10:41:47 +0200
    Good morning,


 I encountered a problem with a text-encoded x-wap.tod header in a WSP
 Reply packet.

 I attached a patch which fixes this for textual values but I'm not sure
 it is the proper fix.
   Quoting WSP 1.0, section 8.4.1.2 ("Field Values"):

    If the field name is encoded in text format, textual values MUST be
    used.


   Regards,

-- 
Lo�c Minier <lool@xxxxxxxxxx>
Index: packet-wsp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-wsp.c,v
retrieving revision 1.72
diff -u -b -r1.72 packet-wsp.c
--- packet-wsp.c	25 Jul 2003 04:11:49 -0000	1.72
+++ packet-wsp.c	25 Jul 2003 08:23:49 -0000
@@ -2298,7 +2298,12 @@
 	{
 		valueType = get_value_type_len (tvb, offset,
 		    &subvalueLen, &subvalueOffset, &offset);
-		if (get_integer (tvb, subvalueOffset, subvalueLen,
+		if (valueType == VALUE_IS_TEXT_STRING) {
+			proto_tree_add_text (tree, tvb, startOffset,
+			    offset - startOffset, "%s: %s", token,
+			    tvb_get_ptr (tvb, subvalueOffset, subvalueLen));
+		}
+		else if (get_integer (tvb, subvalueOffset, subvalueLen,
 		    valueType, &secs) == 0)
 		{
 			/*