(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-q932-ros.c) |
| |
| 435 | | | dissect_q932_ros_ReturnError(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
| 436 | | | #line 7 "ros-err.cnf" |
| 437 | | | dissector_handle_t err_handle = NULL; |
| 438 | | | const gchar *descr = ""; |
| 439 | | | |
| 440 | | | err_next_tvb = NULL; |
| 441 | | | |
| 442 | | | offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, |
| 443 | | | ReturnError_sequence, hf_index, ett_q932_ros_ReturnError); |
| 444 | | | |
| 445 | | | #line 12 "ros-err.cnf" |
| 446 | | | actx->rose_ctx->d.pdu = 3; |
| 447 | | | |
| 448 | | | if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->err_local_dissector_table) { |
| 449 | | | err_handle = dissector_get_port_handle(actx->rose_ctx->err_local_dissector_table, actx->rose_ctx->d.code_local); |
| 450 | | | } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->err_global_dissector_table) { |
| 451 | | | err_handle = dissector_get_string_handle(actx->rose_ctx->err_global_dissector_table, actx->rose_ctx->d.code_global); |
| 452 | | | } else { |
| 453 | | | err_handle = NULL; |
| 454 | | | } |
| 455 | | | |
| 456 | | | if (!err_handle || |
| 457 | | | !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(err_handle)))) { |
| 458 | | | if (actx->rose_ctx->d.code == 0) |
| 459 | | | descr = ep_strdup_printf("ERR: %d", actx->rose_ctx->d.code_local); |
| 460 | | | else if (actx->rose_ctx->d.code == 1) |
| 461 | | | descr = ep_strdup_printf("ERR: %s", actx->rose_ctx->d.code_global); |
Ignored Return Value
The return value of ep_strdup_printf() 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 ep_strdup_printf() 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 ep_strdup_printf() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 462 | | | } else { |
| 463 | | | descr = ep_strdup_printf("ERR:"); |
| 464 | | | } |
| 465 | | | |
| 466 | | | if (actx->rose_ctx->apdu_depth >= 0) |
Event 2:
Skipping " if". actx->rose_ctx->apdu_depth >= 0 evaluates to false.
hide
|
|
| 467 | | | proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr); |
| 468 | | | if (actx->rose_ctx->fillin_info && check_col(actx->pinfo->cinfo, COL_INFO)) |
Event 3:
Skipping " if". - actx->rose_ctx->fillin_info evaluates to true.
- check_col(...) evaluates to false.
hide
|
|
| 469 | | | col_append_str(actx->pinfo->cinfo, COL_INFO, descr); |
| 470 | | | if (actx->rose_ctx->fillin_ptr) |
Event 4:
Skipping " if". actx->rose_ctx->fillin_ptr evaluates to false.
hide
|
|
| 471 | | | g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size); |
| 472 | | | |
| 473 | | | if (!err_next_tvb) { |
Event 5:
Taking true branch. err_next_tvb evaluates to false.
hide
|
|
| 474 | | | err_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0); |
Event 6:
actx->encoding == ASN1_ENC_PER evaluates to true.
hide
|
|
| 475 | | | } |
| 476 | | | actx->pinfo->private_data = actx->rose_ctx; |
| 477 | | | call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree); |
Event 7:
err_handle evaluates to false.
hide
|
|
| 478 | | | |
| 479 | | | return offset; |
| 480 | | | } |
| |