1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 13_CVE-2007-6439.dpatch by Emanuele Gentili <emgent@emanuele-gentili.com>
4
## All lines beginning with `## DP:' are a description of the patch.
8
diff -urNad wireshark-0.99.6rel~/epan/dissectors/packet-ipv6.c wireshark-0.99.6rel/epan/dissectors/packet-ipv6.c
9
--- wireshark-0.99.6rel~/epan/dissectors/packet-ipv6.c 2007-07-05 21:25:02.000000000 +0200
10
+++ wireshark-0.99.6rel/epan/dissectors/packet-ipv6.c 2008-03-24 01:48:31.000000000 +0100
13
static int proto_ipv6 = -1;
14
static int hf_ipv6_version = -1;
15
+static int hf_ip_version = -1;
16
static int hf_ipv6_class = -1;
17
static int hf_ipv6_flow = -1;
18
static int hf_ipv6_plen = -1;
20
static int hf_ipv6_shim6_opt_fii = -1;
22
static gint ett_ipv6 = -1;
23
+static gint ett_ipv6_version = -1;
24
static gint ett_ipv6_shim6 = -1;
25
static gint ett_ipv6_shim6_option = -1;
26
static gint ett_ipv6_shim6_locators = -1;
31
-dissect_shim6_opt_loc_pref(proto_tree * opt_tree, tvbuff_t * tvb, gint *offset, gint len)
32
+dissect_shim6_opt_loc_pref(proto_tree * opt_tree, tvbuff_t * tvb, gint *offset, gint len, packet_info *pinfo)
38
optlen = tvb_get_guint8(tvb, p);
39
proto_tree_add_item(opt_tree, hf_ipv6_shim6_opt_elemlen, tvb, p, 1, FALSE);
41
+ if (optlen < 1 || optlen > 3) {
42
+ it = proto_tree_add_text(opt_tree, tvb, p, 1,
43
+ "Invalid element length: %u", optlen);
44
+ expert_add_info_format(pinfo, it, PI_MALFORMED, PI_ERROR,
45
+ "Invalid element length: %u", optlen);
51
/* Locator Preferences */
56
-dissect_shimopts(tvbuff_t *tvb, int offset, proto_tree *tree)
57
+dissect_shimopts(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo)
62
dissect_shim6_opt_loclist(opt_tree, tvb, &p);
64
case SHIM6_OPT_LOCPREF:
65
- dissect_shim6_opt_loc_pref(opt_tree, tvb, &p, offset+len+4);
66
+ dissect_shim6_opt_loc_pref(opt_tree, tvb, &p, offset+len+4, pinfo);
67
if (total_len-(len+4) > 0)
68
proto_tree_add_text(opt_tree, tvb, p, total_len-(len+4), "Padding");
73
while (p < offset+len) {
74
- p += dissect_shimopts(tvb, p, shim_tree);
75
+ p += dissect_shimopts(tvb, p, shim_tree, pinfo);
79
@@ -1257,13 +1268,20 @@
80
SET_ADDRESS(&pinfo->dst, AT_IPv6, 16, tvb_get_ptr(tvb, offset + IP6H_DST, 16));
86
/* !!! specify length */
87
ti = proto_tree_add_item(tree, proto_ipv6, tvb, offset, 40, FALSE);
88
ipv6_tree = proto_item_add_subtree(ti, ett_ipv6);
90
/* !!! warning: version also contains 4 Bit priority */
91
- proto_tree_add_item(ipv6_tree, hf_ipv6_version, tvb,
92
+ pi = proto_tree_add_item(ipv6_tree, hf_ipv6_version, tvb,
93
+ offset + offsetof(struct ip6_hdr, ip6_vfc), 1, FALSE);
94
+ pt = proto_item_add_subtree(pi,ett_ipv6_version);
95
+ pi = proto_tree_add_item(pt, hf_ip_version, tvb,
96
offset + offsetof(struct ip6_hdr, ip6_vfc), 1, FALSE);
97
+ PROTO_ITEM_SET_GENERATED(pi);
99
proto_tree_add_item(ipv6_tree, hf_ipv6_class, tvb,
100
offset + offsetof(struct ip6_hdr, ip6_flow), 4, FALSE);
101
@@ -1504,6 +1522,10 @@
103
{ "Version", "ipv6.version",
104
FT_UINT8, BASE_DEC, NULL, 0xF0, "", HFILL }},
106
+ { "This field makes the filter \"ip.version == 6\" possible",
108
+ FT_UINT8, BASE_DEC, NULL, 0xF0, "", HFILL }},
110
{ "Traffic class", "ipv6.class",
111
FT_UINT32, BASE_HEX, NULL, 0x0FF00000, "", HFILL }},
112
@@ -1827,6 +1849,7 @@
114
static gint *ett[] = {
118
&ett_ipv6_shim6_option,
119
&ett_ipv6_shim6_locators,
120
diff -urNad wireshark-0.99.6rel~/epan/dissectors/packet-usb.c wireshark-0.99.6rel/epan/dissectors/packet-usb.c
121
--- wireshark-0.99.6rel~/epan/dissectors/packet-usb.c 2007-07-05 21:24:58.000000000 +0200
122
+++ wireshark-0.99.6rel/epan/dissectors/packet-usb.c 2008-03-24 01:53:52.000000000 +0100
124
#include <epan/emem.h>
125
#include <epan/tap.h>
126
#include <epan/conversation.h>
127
+#include <epan/expert.h>
129
#include "packet-usb.h"
132
usb_trans_info->interface_info=se_alloc(sizeof(usb_conv_info_t));
133
usb_trans_info->interface_info->interfaceClass=tvb_get_guint8(tvb, offset);
134
usb_trans_info->interface_info->transactions=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "usb transactions");
135
+ usb_trans_info->interface_info->class_data=NULL;
140
proto_tree_add_item(tree, hf_usb_bLength, tvb, offset, 1, TRUE);
141
bLength = tvb_get_guint8(tvb, offset);
144
+ item = proto_tree_add_text(parent_tree, tvb, offset - 1, 1,
145
+ "Invalid bLength: %u", bLength);
146
+ expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
147
+ "Invalid bLength: %u", bLength);
151
/* bDescriptorType */
152
proto_tree_add_item(tree, hf_usb_bDescriptorType, tvb, offset, 1, TRUE);