(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-frame.c) |
| |
| 115 | | | dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) |
| 116 | | | { |
| 117 | | | proto_tree *fh_tree=NULL; |
| 118 | | | proto_item *volatile ti = NULL; |
| 119 | | | nstime_t ts; |
| 120 | | | int cap_len = 0, frame_len = 0; |
| 121 | | | proto_tree *volatile tree; |
| 122 | | | proto_item *item; |
| 123 | | | guint32 frame_number; |
| 124 | | | |
| 125 | | | frame_number=pinfo->fd->num; |
| 126 | | | |
| 127 | | | |
| 128 | | | |
| 129 | | | tree=parent_tree; |
| 130 | | | |
| 131 | | | pinfo->current_proto = "Frame"; |
| 132 | | | |
| 133 | | | if (pinfo-> != NULL) { |
Event 1:
Taking true branch. pinfo-> != (void *)0 evaluates to true.
hide
|
|
| 134 | | | switch (pinfo->fd->lnk_t) { |
Event 2:
pinfo->fd->lnk_t evaluates to 35.
hide
|
|
| 135 | | | |
| 136 | | | case WTAP_ENCAP_WFLEET_HDLC: |
| 137 | | | case WTAP_ENCAP_CHDLC_WITH_PHDR: |
| 138 | | | case WTAP_ENCAP_PPP_WITH_PHDR: |
| 139 | | | case WTAP_ENCAP_SDLC: |
| 140 | | | case WTAP_ENCAP_BLUETOOTH_H4: |
| 141 | | | case WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR: |
| 142 | | | pinfo->p2p_dir = pinfo->->p2p.sent ? |
Event 3:
pinfo->->p2p.sent evaluates to true.
hide
|
|
| 143 | | | P2P_DIR_SENT : P2P_DIR_RECV; |
| 144 | | | break; |
| 145 | | | |
| 146 | | | case WTAP_ENCAP_BLUETOOTH_HCI:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap.h |
| |
195 | #define WTAP_ENCAP_BLUETOOTH_HCI 102 /*raw packets without a transport layer e.g. H4*/ |
| |
|
| 147 | | | pinfo->p2p_dir = pinfo->->bthci.sent; |
| 148 | | | break; |
| 149 | | | |
| 150 | | | case WTAP_ENCAP_LAPB: |
| 151 | | | case WTAP_ENCAP_FRELAY_WITH_PHDR: |
| 152 | | | pinfo->p2p_dir = |
| 153 | | | (pinfo->->x25.flags & FROM_DCE) ? |
| 154 | | | P2P_DIR_RECV : P2P_DIR_SENT; |
| 155 173 |  | | [ Lines 155 to 173 omitted. ] |
| 174 | | | |
| 175 | | | case WTAP_ENCAP_GSM_UM: |
| 176 | | | pinfo->p2p_dir = pinfo->->gsm_um.uplink ? |
| 177 | | | P2P_DIR_SENT : P2P_DIR_RECV; |
| 178 | | | break; |
| 179 | | | |
| 180 | | | } |
| 181 | | | } |
| 182 | | | |
| 183 | | | |
| 184 | | | if (tree) { |
Event 4:
Taking true branch. tree evaluates to true.
hide
|
|
| 185 | | | cap_len = tvb_length(tvb); |
| 186 | | | frame_len = tvb_reported_length(tvb); |
| 187 | | | |
| 188 | | | ti = proto_tree_add_protocol_format(tree, proto_frame, tvb, 0, -1, |
| 189 | | | "Frame %u (%u bytes on wire, %u bytes captured)", pinfo->fd->num, frame_len, cap_len); |
| 190 | | | |
| 191 | | | fh_tree = proto_item_add_subtree(ti, ett_frame); |
| 192 | | | } |
| 193 | | | |
| 194 | | | |
| 195 | | | |
| 196 | | | |
| 197 | | | |
| 198 | [+] | | if(!proto_field_is_referenced(tree, proto_frame)){ |
 |
| 199 | | | tree=NULL; |
| 200 | | | fh_tree = NULL; |
| 201 | | | } |
| 202 | | | |
| 203 | | | |
| 204 | | | if (fh_tree) { |
Event 9:
Taking true branch. fh_tree evaluates to true.
hide
|
|
| 205 | | | ts = pinfo->fd->abs_ts; |
| 206 | | | |
| 207 | | | proto_tree_add_time(fh_tree, hf_frame_arrival_time, tvb, |
| 208 | | | 0, 0, &ts); |
| 209 | | | if(ts.nsecs < 0 || ts.nsecs >= 1000000000) { |
| 210 | | | item = proto_tree_add_none_format(fh_tree, hf_frame_time_invalid, tvb, |
| 211 | | | 0, 0, "Arrival Time: Fractional second %09ld is invalid, the valid range is 0-1000000000", (long) ts.nsecs); |
| 212 | | | PROTO_ITEM_SET_GENERATED(item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
Event 11:
item evaluates to true.
hide
|
|
| 213 | | | expert_add_info_format(pinfo, item, PI_MALFORMED, PI_WARN, "Arrival Time: Fractional second out of range (0-1000000000)"); |
| 214 | | | } |
| 215 | | | |
| 216 | | | ts = pinfo->fd->del_cap_ts; |
| 217 | | | |
| 218 | | | item = proto_tree_add_time(fh_tree, hf_frame_time_delta, tvb, |
| 219 | | | 0, 0, &ts); |
| 220 | | | PROTO_ITEM_SET_GENERATED(item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
Event 12:
item evaluates to true.
hide
|
|
| 221 | | | |
| 222 | | | ts = pinfo->fd->del_dis_ts; |
| 223 | | | |
| 224 | | | item = proto_tree_add_time(fh_tree, hf_frame_time_delta_displayed, tvb, |
| 225 | | | 0, 0, &ts); |
| 226 | | | PROTO_ITEM_SET_GENERATED(item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
Event 13:
item evaluates to true.
hide
|
|
| 227 | | | |
| 228 | | | ts = pinfo->fd->rel_ts; |
| 229 | | | |
| 230 | | | item = proto_tree_add_time(fh_tree, hf_frame_time_relative, tvb, |
| 231 | | | 0, 0, &ts); |
| 232 | | | PROTO_ITEM_SET_GENERATED(item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
Event 14:
item evaluates to true.
hide
|
|
| 233 | | | |
| 234 | | | if(pinfo->fd->flags.ref_time){ |
Event 15:
Taking true branch. pinfo->fd->flags.ref_time evaluates to true.
hide
|
|
| 235 | [+] | | ti = proto_tree_add_item(fh_tree, hf_frame_time_reference, tvb, 0, 0, FALSE); |
 |
| 236 | | | PROTO_ITEM_SET_GENERATED(ti);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
Event 24:
ti evaluates to true.
hide
Null Pointer Dereference
ti is dereferenced here, but it is NULL. The issue can occur if the highlighted code executes. See related event 23. Show: All events | Only primary events |
|
| |