(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-udp.c) |
| |
| 304 | | | dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto) |
| 305 | | | { |
| 306 | | | proto_tree *udp_tree = NULL; |
| 307 | | | proto_item *ti, *hidden_item; |
| 308 | | | guint len; |
| 309 | | | guint reported_len; |
| 310 | | | vec_t cksum_vec[4]; |
| 311 | | | guint32 phdr[2]; |
| 312 | | | guint16 computed_cksum; |
| 313 | | | int offset = 0; |
| 314 | | | e_udphdr *udph; |
| 315 | | | proto_tree *checksum_tree; |
| 316 | | | proto_item *item; |
| 317 | | | conversation_t *conv = NULL; |
| 318 | | | struct udp_analysis *udpd = NULL; |
| 319 | | | proto_tree *process_tree; |
| 320 | | | |
| 321 | | | udph=ep_alloc(sizeof(e_udphdr)); |
| 322 | | | SET_ADDRESS(&udph->ip_src, pinfo->src.type, pinfo->src.len, pinfo->src.data);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/address.h |
| |
66 | #define SET_ADDRESS(addr, addr_type, addr_len, addr_data) { \ |
67 | (addr)->type = (addr_type); \ |
68 | (addr)->len = (addr_len); \ |
69 | (addr)->data = (addr_data); \ |
70 | } |
| |
|
| 323 | | | SET_ADDRESS(&udph->ip_dst, pinfo->dst.type, pinfo->dst.len, pinfo->dst.data);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/address.h |
| |
66 | #define SET_ADDRESS(addr, addr_type, addr_len, addr_data) { \ |
67 | (addr)->type = (addr_type); \ |
68 | (addr)->len = (addr_len); \ |
69 | (addr)->data = (addr_data); \ |
70 | } |
| |
|
| 324 | | | |
| 325 | | | if (check_col(pinfo->cinfo, COL_PROTOCOL)) |
| 326 | | | col_set_str(pinfo->cinfo, COL_PROTOCOL, (ip_proto == IP_PROTO_UDP) ? "UDP" : "UDPlite");
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/ipproto.h |
| |
52 | #define IP_PROTO_UDP 17 /* user datagram protocol - RFC768 */ |
| |
|
| 327 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 328 | | | col_clear(pinfo->cinfo, COL_INFO); |
| 329 | | | |
| 330 | | | udph->uh_sport=tvb_get_ntohs(tvb, offset); |
| 331 | | | udph->uh_dport=tvb_get_ntohs(tvb, offset+2); |
| 332 | | | |
| 333 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 334 | | | col_add_fstr(pinfo->cinfo, COL_INFO, "Source port: %s Destination port: %s", |
| 335 | | | get_udp_port(udph->uh_sport), get_udp_port(udph->uh_dport)); |
| 336 | | | |
| 337 | | | if (tree) { |
| 338 | | | if (udp_summary_in_tree) { |
| 339 | | | if (ip_proto == IP_PROTO_UDP) {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/ipproto.h |
| |
52 | #define IP_PROTO_UDP 17 /* user datagram protocol - RFC768 */ |
| |
|
| 340 | | | ti = proto_tree_add_protocol_format(tree, proto_udp, tvb, offset, 8, |
| 341 | | | "User Datagram Protocol, Src Port: %s (%u), Dst Port: %s (%u)", |
| 342 | | | get_udp_port(udph->uh_sport), udph->uh_sport, get_udp_port(udph->uh_dport), udph->uh_dport); |
| 343 | | | } else { |
| 344 | | | ti = proto_tree_add_protocol_format(tree, proto_udplite, tvb, offset, 8, |
| 345 | | | "Lightweight User Datagram Protocol, Src Port: %s (%u), Dst Port: %s (%u)", |
| 346 | | | get_udp_port(udph->uh_sport), udph->uh_sport, get_udp_port(udph->uh_dport), udph->uh_dport); |
| 347 | | | } |
| 348 | | | } else { |
| 349 | | | ti = proto_tree_add_item(tree, (ip_proto == IP_PROTO_UDP) ? proto_udp : proto_udplite, tvb, offset, 8, FALSE);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/ipproto.h |
| |
52 | #define IP_PROTO_UDP 17 /* user datagram protocol - RFC768 */ |
| |
|
| 350 | | | } |
| 351 | | | udp_tree = proto_item_add_subtree(ti, ett_udp); |
| 352 | | | |
| 353 | | | proto_tree_add_uint_format(udp_tree, hf_udp_srcport, tvb, offset, 2, udph->uh_sport, |
| 354 | | | "Source port: %s (%u)", get_udp_port(udph->uh_sport), udph->uh_sport); |
| 355 | | | proto_tree_add_uint_format(udp_tree, hf_udp_dstport, tvb, offset + 2, 2, udph->uh_dport, |
| 356 | | | "Destination port: %s (%u)", get_udp_port(udph->uh_dport), udph->uh_dport); |
| 357 | | | |
| 358 | | | hidden_item = proto_tree_add_uint(udp_tree, hf_udp_port, tvb, offset, 2, udph->uh_sport); |
| 359 | | | PROTO_ITEM_SET_HIDDEN(hidden_item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
319 | #define PROTO_ITEM_SET_HIDDEN(proto_item) \ |
320 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 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) |
| |
|
| 360 | | | hidden_item = proto_tree_add_uint(udp_tree, hf_udp_port, tvb, offset+2, 2, udph->uh_dport); |
| 361 | | | PROTO_ITEM_SET_HIDDEN(hidden_item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
319 | #define PROTO_ITEM_SET_HIDDEN(proto_item) \ |
320 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 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) |
| |
|
| 362 | | | } |
| 363 | | | |
| 364 | | | if (ip_proto == IP_PROTO_UDP) {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/ipproto.h |
| |
52 | #define IP_PROTO_UDP 17 /* user datagram protocol - RFC768 */ |
| |
|
| 365 | | | udph->uh_ulen = udph->uh_sum_cov = tvb_get_ntohs(tvb, offset+4); |
| 366 | | | if (udph->uh_ulen < 8) { |
| 367 | | | |
| 368 | | | |
| 369 | | | item = proto_tree_add_uint_format(udp_tree, hf_udp_length, tvb, offset + 4, 2, |
| 370 | | | udph->uh_ulen, "Length: %u (bogus, must be >= 8)", udph->uh_ulen); |
| 371 | | | expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR, "Bad length value %u < 8", udph->uh_ulen); |
| 372 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 373 | | | col_append_fstr(pinfo->cinfo, COL_INFO, " [BAD UDP LENGTH %u < 8]", udph->uh_ulen); |
| 374 | | | return; |
| 375 | | | } |
| 376 | | | if ((udph->uh_ulen > tvb_reported_length(tvb)) && ! pinfo->fragmented && ! pinfo->in_error_pkt) { |
| 377 | | | |
| 378 | | | item = proto_tree_add_uint_format(udp_tree, hf_udp_length, tvb, offset + 4, 2, |
| 379 | | | udph->uh_ulen, "Length: %u (bogus, payload length %u)", udph->uh_ulen, tvb_reported_length(tvb)); |
| 380 | | | expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR, "Bad length value %u > IP payload length", udph->uh_ulen); |
| 381 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 382 | | | col_append_fstr(pinfo->cinfo, COL_INFO, " [BAD UDP LENGTH %u > IP PAYLOAD LENGTH]", udph->uh_ulen); |
| 383 | | | } else { |
| 384 | | | if (tree) { |
| 385 | | | proto_tree_add_uint(udp_tree, hf_udp_length, tvb, offset + 4, 2, udph->uh_ulen); |
| 386 | | | |
| 387 | | | hidden_item = proto_tree_add_uint(udp_tree, hf_udplite_checksum_coverage, tvb, offset + 4, |
| 388 | | | 0, udph->uh_sum_cov); |
| 389 | | | PROTO_ITEM_SET_HIDDEN(hidden_item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
319 | #define PROTO_ITEM_SET_HIDDEN(proto_item) \ |
320 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 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) |
| |
|
| 390 | | | } |
| 391 | | | } |
| 392 | | | } else { |
| 393 | | | udph->uh_ulen = pinfo->iplen - pinfo->iphdrlen; |
| 394 | | | udph->uh_sum_cov = tvb_get_ntohs(tvb, offset+4); |
| 395 | | | if (((udph->uh_sum_cov > 0) && (udph->uh_sum_cov < 8)) || (udph->uh_sum_cov > udph->uh_ulen)) { |
| 396 | | | |
| 397 | | | if (tree) { |
| 398 | | | hidden_item = proto_tree_add_boolean(udp_tree, hf_udplite_checksum_coverage_bad, tvb, offset + 4, 2, TRUE); |
| 399 | | | PROTO_ITEM_SET_HIDDEN(hidden_item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
319 | #define PROTO_ITEM_SET_HIDDEN(proto_item) \ |
320 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 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) |
| |
|
| 400 | | | hidden_item = proto_tree_add_uint(udp_tree, hf_udp_length, tvb, offset + 4, 0, udph->uh_ulen); |
| 401 | | | PROTO_ITEM_SET_HIDDEN(hidden_item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
319 | #define PROTO_ITEM_SET_HIDDEN(proto_item) \ |
320 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 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) |
| |
|
| 402 | | | } |
| 403 | | | item = proto_tree_add_uint_format(udp_tree, hf_udplite_checksum_coverage, tvb, offset + 4, 2, |
| 404 | | | udph->uh_sum_cov, "Checksum coverage: %u (bogus, must be >= 8 and <= %u (ip.len-ip.hdr_len))", |
| 405 | | | udph->uh_sum_cov, udph->uh_ulen); |
| 406 | | | expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR, "Bad checksum coverage length value %u < 8 or > %u", |
| 407 | | | udph->uh_sum_cov, udph->uh_ulen); |
| 408 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 409 | | | col_append_fstr(pinfo->cinfo, COL_INFO, " [BAD LIGHTWEIGHT UDP CHECKSUM COVERAGE LENGTH %u < 8 or > %u]", |
| 410 | | | udph->uh_sum_cov, udph->uh_ulen); |
| 411 | | | if (!udplite_ignore_checksum_coverage) |
| 412 | | | return; |
| 413 | | | } else { |
| 414 | | | if (tree) { |
| 415 | | | hidden_item = proto_tree_add_uint(udp_tree, hf_udp_length, tvb, offset + 4, 0, udph->uh_ulen); |
| 416 | | | PROTO_ITEM_SET_HIDDEN(hidden_item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
319 | #define PROTO_ITEM_SET_HIDDEN(proto_item) \ |
320 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 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) |
| |
|
| 417 | | | proto_tree_add_uint(udp_tree, hf_udplite_checksum_coverage, tvb, offset + 4, 2, udph->uh_sum_cov); |
| 418 | | | } |
| 419 | | | } |
| 420 | | | } |
| 421 | | | |
| 422 | | | udph->uh_sum_cov = (udph->uh_sum_cov) ? udph->uh_sum_cov : udph->uh_ulen; |
| 423 | | | udph->uh_sum = tvb_get_ntohs(tvb, offset+6); |
| 424 | | | reported_len = tvb_reported_length(tvb); |
| 425 | | | len = tvb_length(tvb); |
| 426 | | | if (udph->uh_sum == 0) { |
| 427 | | | |
| 428 | | | if (ip_proto == IP_PROTO_UDP) {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/ipproto.h |
| |
52 | #define IP_PROTO_UDP 17 /* user datagram protocol - RFC768 */ |
| |
|
| 429 | | | item = proto_tree_add_uint_format(udp_tree, hf_udp_checksum, tvb, offset + 6, 2, 0, |
| 430 | | | "Checksum: 0x%04x (none)", 0); |
| 431 | | | |
| 432 | | | checksum_tree = proto_item_add_subtree(item, ett_udp_checksum); |
| 433 | | | proto_tree_add_boolean(checksum_tree, hf_udp_checksum_good, tvb, |
| 434 | | | offset + 6, 2, FALSE); |
| 435 | | | proto_tree_add_boolean(checksum_tree, hf_udp_checksum_bad, tvb, |
| 436 | | | offset + 6, 2, FALSE); |
| 437 | | | } else { |
| 438 | | | item = proto_tree_add_uint_format(udp_tree, hf_udp_checksum, tvb, offset + 6, 2, 0, |
| 439 | | | "Checksum: 0x%04x (Illegal)", 0); |
| 440 | | | expert_add_info_format(pinfo, item, PI_CHECKSUM, PI_ERROR, "Illegal Checksum value (0)"); |
| 441 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 442 | | | col_append_fstr(pinfo->cinfo, COL_INFO, " [ILLEGAL CHECKSUM (0)]"); |
| 443 | | | |
| 444 | | | checksum_tree = proto_item_add_subtree(item, ett_udp_checksum); |
| 445 | | | item = proto_tree_add_boolean(checksum_tree, hf_udp_checksum_good, tvb, |
| 446 | | | offset + 6, 2, FALSE); |
| 447 | | | 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) |
| |
|
| 448 | | | item = proto_tree_add_boolean(checksum_tree, hf_udp_checksum_bad, tvb, |
| 449 | | | offset + 6, 2, TRUE); |
| 450 | | | 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) |
| |
|
| 451 | | | } |
| 452 | | | } else if (!pinfo->fragmented && len >= reported_len && |
| 453 | | | len >= udph->uh_sum_cov && reported_len >= udph->uh_sum_cov && |
| 454 | | | udph->uh_sum_cov >=8) { |
| 455 | | | |
| 456 | | | |
| 457 | | | |
| 458 | | | |
| 459 | | | |
| 460 | | | if (((ip_proto == IP_PROTO_UDP) && (udp_check_checksum)) ||
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/ipproto.h |
| |
52 | #define IP_PROTO_UDP 17 /* user datagram protocol - RFC768 */ |
| |
|
| 461 | | | ((ip_proto == IP_PROTO_UDPLITE) && (udplite_check_checksum))) {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/ipproto.h |
| |
185 | #define IP_PROTO_UDPLITE 136 /* Lightweight user datagram protocol - RFC3828 */ |
| |
|
| 462 | | | |
| 463 | | | cksum_vec[0].ptr = pinfo->src.data; |
| 464 | | | cksum_vec[0].len = pinfo->src.len; |
| 465 | | | cksum_vec[1].ptr = pinfo->dst.data; |
| 466 | | | cksum_vec[1].len = pinfo->dst.len; |
| 467 | | | cksum_vec[2].ptr = (const guint8 *)&phdr; |
| 468 | | | switch (pinfo->src.type) { |
| 469 | | | |
| 470 | | | case AT_IPv4: |
| 471 | | | phdr[0] = g_htonl((ip_proto<<16) + reported_len);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
349 | #define g_htonl(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
| 472 | | | cksum_vec[2].len = 4; |
| 473 | | | break; |
| 474 | | | |
| 475 | | | case AT_IPv6: |
| 476 | | | phdr[0] = g_htonl(reported_len);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
349 | #define g_htonl(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
| 477 | | | phdr[1] = g_htonl(ip_proto);
x /usr/include/glib-2.0/glib/gtypes.h |
| |
349 | #define g_htonl(val) (GUINT32_TO_BE (val)) |
| |
x /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h |
| |
196 | #define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
229 | # define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_IA32 (val)) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
203 | # define GUINT32_SWAP_LE_BE_IA32(val) \ |
204 | (__extension__ \ |
205 | ({ register guint32 __v, __x = ((guint32) (val)); \ |
206 | if (__builtin_constant_p (__x)) \ |
207 | __v = GUINT32_SWAP_LE_BE_CONSTANT (__x); \ |
208 | else \ |
209 | __asm__ ("bswap %0" \ |
210 | : "=r" (__v) \ |
211 | : "0" (__x)); \ |
212 | __v; })) |
| |
x /usr/include/glib-2.0/glib/gtypes.h |
| |
147 | #define GUINT32_SWAP_LE_BE_CONSTANT(val) ((guint32) ( \ |
148 | (((guint32) (val) & (guint32) 0x000000ffU) << 24) | \ |
149 | (((guint32) (val) & (guint32) 0x0000ff00U) << 8) | \ |
150 | (((guint32) (val) & (guint32) 0x00ff0000U) >> 8) | \ |
151 | (((guint32) (val) & (guint32) 0xff000000U) >> 24))) |
| |
|
| 478 | | | cksum_vec[2].len = 8; |
| 479 | | | break; |
| 480 | | | |
| 481 | | | default: |
| 482 | | | |
| 483 | | | DISSECTOR_ASSERT_NOT_REACHED();
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
131 | #define DISSECTOR_ASSERT_NOT_REACHED() \ |
132 | (REPORT_DISSECTOR_BUG( \ |
133 | ep_strdup_printf("%s:%u: failed assertion \"DISSECTOR_ASSERT_NOT_REACHED\"", \ |
134 | __FILE__, __LINE__))) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
106 | #define REPORT_DISSECTOR_BUG(message) \ |
107 | ((getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL) ? \ |
108 | abort() : \ |
109 | THROW_MESSAGE(DissectorError, message)) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/exceptions.h |
| |
226 | #define THROW_MESSAGE(x, y) \ |
227 | except_throw(XCEPT_GROUP_WIRESHARK, (x), (y)) |
| |
|
| 484 | | | break; |
Unreachable Control Flow
The highlighted code will not execute under any circumstances. This may be because of: |
|
| 485 | | | } |
| 486 | | | cksum_vec[3].ptr = tvb_get_ptr(tvb, offset, udph->uh_sum_cov); |
| 487 | | | cksum_vec[3].len = udph->uh_sum_cov; |
| 488 | | | computed_cksum = in_cksum(&cksum_vec[0], 4); |
| 489 | | | if (computed_cksum == 0) { |
| 490 | | | item = proto_tree_add_uint_format(udp_tree, hf_udp_checksum, tvb, |
| 491 | | | offset + 6, 2, udph->uh_sum, "Checksum: 0x%04x [correct]", udph->uh_sum); |
| 492 | | | |
| 493 | | | checksum_tree = proto_item_add_subtree(item, ett_udp_checksum); |
| 494 | | | item = proto_tree_add_boolean(checksum_tree, hf_udp_checksum_good, tvb, |
| 495 | | | offset + 6, 2, TRUE); |
| 496 | | | 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) |
| |
|
| 497 | | | item = proto_tree_add_boolean(checksum_tree, hf_udp_checksum_bad, tvb, |
| 498 | | | offset + 6, 2, FALSE); |
| 499 | | | 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) |
| |
|
| 500 | | | } else { |
| 501 | | | item = proto_tree_add_uint_format(udp_tree, hf_udp_checksum, tvb, |
| 502 | | | offset + 6, 2, udph->uh_sum, |
| 503 | | | "Checksum: 0x%04x [incorrect, should be 0x%04x (maybe caused by \"UDP checksum offload\"?)]", udph->uh_sum, |
| 504 | | | in_cksum_shouldbe(udph->uh_sum, computed_cksum)); |
| 505 | | | |
| 506 | | | checksum_tree = proto_item_add_subtree(item, ett_udp_checksum); |
| 507 | | | item = proto_tree_add_boolean(checksum_tree, hf_udp_checksum_good, tvb, |
| 508 | | | offset + 6, 2, FALSE); |
| 509 | | | 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) |
| |
|
| 510 | | | item = proto_tree_add_boolean(checksum_tree, hf_udp_checksum_bad, tvb, |
| 511 | | | offset + 6, 2, TRUE); |
| 512 | | | 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) |
| |
|
| 513 | | | expert_add_info_format(pinfo, item, PI_CHECKSUM, PI_ERROR, "Bad checksum"); |
| 514 | | | |
| 515 | | | if (check_col(pinfo->cinfo, COL_INFO)) |
| 516 | | | col_append_fstr(pinfo->cinfo, COL_INFO, " [UDP CHECKSUM INCORRECT]"); |
| 517 | | | } |
| 518 | | | } else { |
| 519 | | | item = proto_tree_add_uint_format(udp_tree, hf_udp_checksum, tvb, |
| 520 | | | offset + 6, 2, udph->uh_sum, "Checksum: 0x%04x [validation disabled]", udph->uh_sum); |
| 521 | | | checksum_tree = proto_item_add_subtree(item, ett_udp_checksum); |
| 522 | | | item = proto_tree_add_boolean(checksum_tree, hf_udp_checksum_good, tvb, |
| 523 | | | offset + 6, 2, FALSE); |
| 524 | | | 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) |
| |
|
| 525 | | | item = proto_tree_add_boolean(checksum_tree, hf_udp_checksum_bad, tvb, |
| 526 | | | offset + 6, 2, FALSE); |
| 527 | | | 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) |
| |
|
| 528 | | | } |
| 529 | | | } else { |
| 530 | | | item = proto_tree_add_uint_format(udp_tree, hf_udp_checksum, tvb, |
| 531 | | | offset + 6, 2, udph->uh_sum, "Checksum: 0x%04x [unchecked, not all data available]", udph->uh_sum); |
| 532 | | | |
| 533 | | | checksum_tree = proto_item_add_subtree(item, ett_udp_checksum); |
| 534 | | | item = proto_tree_add_boolean(checksum_tree, hf_udp_checksum_good, tvb, |
| 535 | | | offset + 6, 2, FALSE); |
| 536 | | | 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) |
| |
|
| 537 | | | item = proto_tree_add_boolean(checksum_tree, hf_udp_checksum_bad, tvb, |
| 538 | | | offset + 6, 2, FALSE); |
| 539 | | | 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) |
| |
|
| 540 | | | } |
| 541 | | | |
| 542 | | | |
| 543 | | | offset += 8; |
| 544 | | | |
| 545 | | | pinfo->ptype = PT_UDP; |
| 546 | | | pinfo->srcport = udph->uh_sport; |
| 547 | | | pinfo->destport = udph->uh_dport; |
| 548 | | | |
| 549 | | | tap_queue_packet(udp_tap, pinfo, udph); |
| 550 | | | |
| 551 | | | |
| 552 | | | if (udp_process_info) { |
| 553 | | | conv=get_udp_conversation(pinfo); |
| 554 | | | udpd=get_udp_conversation_data(conv,pinfo); |
| 555 | | | } |
| 556 | | | |
| 557 | | | if (udpd && (udpd->fwd || udpd->rev) && (udpd->fwd->command || udpd->rev->command)) { |
| 558 | | | ti = proto_tree_add_text(udp_tree, tvb, offset, 0, "Process Information"); |
| 559 | | | 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) |
| |
|
| 560 | | | process_tree = proto_item_add_subtree(ti, ett_udp_process_info); |
| 561 | | | if (udpd->fwd->command) { |
| 562 | | | proto_tree_add_uint_format_value(process_tree, hf_udp_proc_dst_uid, tvb, 0, 0, |
| 563 | | | udpd->fwd->process_uid, "%u", udpd->fwd->process_uid); |
| 564 | | | proto_tree_add_uint_format_value(process_tree, hf_udp_proc_dst_pid, tvb, 0, 0, |
| 565 | | | udpd->fwd->process_pid, "%u", udpd->fwd->process_pid); |
| 566 | | | proto_tree_add_string_format_value(process_tree, hf_udp_proc_dst_uname, tvb, 0, 0, |
| 567 | | | udpd->fwd->username, "%s", udpd->fwd->username); |
| 568 | | | proto_tree_add_string_format_value(process_tree, hf_udp_proc_dst_cmd, tvb, 0, 0, |
| 569 | | | udpd->fwd->command, "%s", udpd->fwd->command); |
| 570 | | | } |
| 571 | | | if (udpd->rev->command) { |
| 572 | | | proto_tree_add_uint_format_value(process_tree, hf_udp_proc_src_uid, tvb, 0, 0, |
| 573 | | | udpd->rev->process_uid, "%u", udpd->rev->process_uid); |
| 574 | | | proto_tree_add_uint_format_value(process_tree, hf_udp_proc_src_pid, tvb, 0, 0, |
| 575 | | | udpd->rev->process_pid, "%u", udpd->rev->process_pid); |
| 576 | | | proto_tree_add_string_format_value(process_tree, hf_udp_proc_src_uname, tvb, 0, 0, |
| 577 | | | udpd->rev->username, "%s", udpd->rev->username); |
| 578 | | | proto_tree_add_string_format_value(process_tree, hf_udp_proc_src_cmd, tvb, 0, 0, |
| 579 | | | udpd->rev->command, "%s", udpd->rev->command); |
| 580 | | | } |
| 581 | | | } |
| 582 | | | |
| 583 | | | |
| 584 | | | |
| 585 | | | |
| 586 | | | |
| 587 | | | |
| 588 | | | |
| 589 | | | |
| 590 | | | |
| 591 | | | |
| 592 | | | |
| 593 | | | |
| 594 | | | |
| 595 | | | if (!pinfo->in_error_pkt || tvb_length_remaining(tvb, offset) > 0) |
| 596 | | | decode_udp_ports(tvb, offset, pinfo, tree, udph->uh_sport, udph->uh_dport, |
| 597 | | | udph->uh_ulen); |
| 598 | | | } |
| |