(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-giop.c) |
| |
| 2437 | | | guint32 get_CDR_typeCode(tvbuff_t *tvb, proto_tree *tree, gint *offset, |
| 2438 | | | gboolean stream_is_big_endian, int boundary, |
| 2439 | | | * ) { |
| 2440 | | | guint32 val; |
| 2441 | | | |
| 2442 | | | gint16 s_octet2; |
| 2443 | | | guint16 u_octet2; |
| 2444 | | | guint32 u_octet4; |
| 2445 | | | |
| 2446 | | | val = get_CDR_ulong(tvb,offset,stream_is_big_endian,boundary); |
| 2447 | | | if (tree) { |
| 2448 | | | proto_tree_add_uint(tree,hf_giop_TCKind,tvb, |
| 2449 | | | *offset-sizeof(val),4,val); |
| 2450 | | | } |
| 2451 | | | |
| 2452 | | | |
| 2453 | | | |
| 2454 | | | switch (val) { |
| 2455 | | | case tk_null: |
| 2456 | | | break; |
| 2457 | | | case tk_void: |
| 2458 | | | break; |
| 2459 | | | case tk_short: |
| 2460 | | | break; |
| 2461 | | | case tk_long: |
| 2462 | | | break; |
| 2463 | | | case tk_ushort: |
| 2464 | | | break; |
| 2465 | | | case tk_ulong: |
| 2466 | | | break; |
| 2467 | | | case tk_float: |
| 2468 | | | break; |
| 2469 | | | case tk_double: |
| 2470 | | | break; |
| 2471 | | | case tk_boolean: |
| 2472 | | | break; |
| 2473 | | | case tk_char: |
| 2474 | | | break; |
| 2475 | | | case tk_octet: |
| 2476 | | | break; |
| 2477 | | | case tk_any: |
| 2478 | | | break; |
| 2479 | | | case tk_TypeCode: |
| 2480 | | | break; |
| 2481 | | | case tk_Principal: |
| 2482 | | | break; |
| 2483 | | | case tk_objref: |
| 2484 | | | dissect_tk_objref_params(tvb, tree, offset, stream_is_big_endian, boundary); |
| 2485 | | | break; |
| 2486 | | | case tk_struct: |
| 2487 | | | dissect_tk_struct_params(tvb, tree, offset, stream_is_big_endian, boundary, ); |
| 2488 | | | break; |
| 2489 | | | case tk_union: |
| 2490 | | | dissect_tk_union_params(tvb, tree, offset, stream_is_big_endian, boundary, ); |
| 2491 | | | break; |
| 2492 | | | case tk_enum: |
| 2493 | | | dissect_tk_enum_params(tvb, tree, offset, stream_is_big_endian, boundary); |
| 2494 | | | break; |
| 2495 | | | |
| 2496 | | | case tk_string: |
| 2497 | | | u_octet4 = get_CDR_ulong(tvb,offset,stream_is_big_endian,boundary); |
| 2498 | | | if (tree) { |
| 2499 | | | proto_tree_add_uint(tree,hf_giop_typecode_max_length,tvb, |
| 2500 | | | *offset-sizeof(u_octet4),4,u_octet4); |
| 2501 | | | } |
| 2502 | | | break; |
| 2503 | | | |
| 2504 | | | case tk_sequence: |
| 2505 | | | dissect_tk_sequence_params(tvb, tree, offset, stream_is_big_endian, boundary, ); |
| 2506 | | | break; |
| 2507 | | | case tk_array: |
| 2508 | | | dissect_tk_array_params(tvb, tree, offset, stream_is_big_endian, boundary, ); |
| 2509 | | | break; |
| 2510 | | | case tk_alias: |
| 2511 | | | dissect_tk_alias_params(tvb, tree, offset, stream_is_big_endian, boundary, ); |
| 2512 | | | break; |
| 2513 | | | case tk_except: |
| 2514 | | | dissect_tk_except_params(tvb, tree, offset, stream_is_big_endian, boundary, ); |
| 2515 | | | break; |
| 2516 | | | case tk_longlong: |
| 2517 | | | break; |
| 2518 | | | case tk_ulonglong: |
| 2519 | | | break; |
| 2520 | | | case tk_longdouble: |
| 2521 | | | break; |
| 2522 | | | case tk_wchar: |
| 2523 | | | break; |
| 2524 | | | case tk_wstring: |
| 2525 | | | u_octet4 = get_CDR_ulong(tvb,offset,stream_is_big_endian,boundary); |
Ignored Return Value
The return value of get_CDR_ulong() is never checked in the highlighted execution scenario. - If the return value can indicate an error, the error will be ignored if the highlighted code executes.
- The return value of get_CDR_ulong() is checked 97% of the time in this project. CodeSonar is configured to enforce Ignored Return Value checks for any function whose return value is checked at least 96% of the time, unless the function is used fewer than 20 times. (To modify these thresholds, use configuration file parameters RETURN_CHECKER_SAMPLE_SIZE and RETURN_CHECKER_RATIO. To exempt get_CDR_ulong() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 2526 | | | if (tree) { |
Event 2:
Skipping " if". tree evaluates to false.
hide
|
|
| 2527 | | | proto_tree_add_uint(tree,hf_giop_typecode_max_length,tvb, |
| 2528 | | | *offset-sizeof(u_octet4),4,u_octet4); |
| 2529 | | | } |
| 2530 | | | break; |
| 2531 | | | |
| 2532 | | | case tk_fixed: |
| 2533 | | | u_octet2 = get_CDR_ushort(tvb,offset,stream_is_big_endian,boundary); |
| 2534 | | | if (tree) { |
| 2535 | | | proto_tree_add_uint(tree,hf_giop_typecode_digits,tvb, |
| 2536 | | | *offset-sizeof(u_octet2),2,u_octet2); |
| 2537 | | | } |
| 2538 | | | |
| 2539 | | | s_octet2 = get_CDR_short(tvb,offset,stream_is_big_endian,boundary); |
| 2540 | | | if (tree) { |
| 2541 | | | proto_tree_add_int(tree,hf_giop_typecode_scale,tvb, |
| 2542 | | | *offset-sizeof(s_octet2),2,s_octet2); |
| 2543 | | | } |
| 2544 | | | break; |
| 2545 | | | |
| 2546 | | | case tk_value: |
| 2547 | | | dissect_tk_value_params(tvb, tree, offset, stream_is_big_endian, boundary, ); |
| 2548 | | | break; |
| 2549 | | | case tk_value_box: |
| 2550 | | | dissect_tk_value_box_params(tvb, tree, offset, stream_is_big_endian, boundary, ); |
| 2551 | | | break; |
| 2552 | | | case tk_native: |
| 2553 | | | dissect_tk_native_params(tvb, tree, offset, stream_is_big_endian, boundary); |
| 2554 | | | break; |
| 2555 | | | case tk_abstract_interface: |
| 2556 | | | dissect_tk_abstract_interface_params(tvb, tree, offset, stream_is_big_endian, boundary ); |
| 2557 | | | break; |
| 2558 | | | default: |
| 2559 | | | g_warning("giop: Unknown TCKind %u \n", val);
x /usr/include/glib-2.0/glib/gmessages.h |
| |
153 | #define g_warning(...) g_log (G_LOG_DOMAIN, \ |
154 | G_LOG_LEVEL_WARNING, \ |
155 | __VA_ARGS__) |
| |
|
| 2560 | | | break; |
| 2561 | | | } |
| 2562 | | | |
| 2563 | | | return val; |
| 2564 | | | } |
| |