As suggested by Georg von Zezschwitz, check whether all the bytes of the
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 29 Jul 2003 21:30:32 +0000 (21:30 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 29 Jul 2003 21:30:32 +0000 (21:30 +0000)
URI are present before processing it, to catch bogus length values.

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

packet-wsp.c

index a54a6efa165cd92ed9cbeb3a23d3557e63dd44c9..7e215bb709b2c777689e5f0da2d114d3e0673112 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Routines to dissect WSP component of WAP traffic.
  *
- * $Id: packet-wsp.c,v 1.72 2003/07/25 04:11:49 gram Exp $
+ * $Id: packet-wsp.c,v 1.73 2003/07/29 21:30:32 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1614,6 +1614,7 @@ add_uri (proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint URILenOffset
        if (tree)
                ti = proto_tree_add_uint (tree, hf_wsp_header_uri_len,tvb,URILenOffset,count,uriLen);
 
+       tvb_ensure_bytes_exist(tvb, URIOffset, uriLen);
        if (tree)
                ti = proto_tree_add_item (tree, hf_wsp_header_uri,tvb,URIOffset,uriLen,bo_little_endian);
        if (check_col(pinfo->cinfo, COL_INFO)) {