(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ldap.c) |
| |
| 2120 | | | dissect_ldap_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
| 2121 | | | #line 462 "ldap.cnf" |
| 2122 | | | |
| 2123 | | | tvbuff_t *next_tvb; |
| 2124 | | | gchar *string; |
| 2125 | | | guint32 i, len; |
| 2126 | | | int old_offset = offset; |
| 2127 | | | |
| 2128 | | | |
| 2129 | | | offset = dissect_ber_octet_string(FALSE, actx, NULL, tvb, offset, hf_index, &next_tvb); |
Ignored Return Value
The return value of dissect_ber_octet_string() 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 dissect_ber_octet_string() is checked 98% 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 dissect_ber_octet_string() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 2130 | | | |
| 2131 | | | |
| 2132 | | | if(!attr_type || !dissector_try_string(ldap_name_dissector_table, attr_type, next_tvb, actx->pinfo, tree)) { |
Event 2:
Taking true branch. attr_type evaluates to false.
hide
|
|
| 2133 | | | offset = old_offset; |
| 2134 | | | |
| 2135 | | | |
| 2136 | | | offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, |
| 2137 | | | NULL); |
| 2138 | | | |
| 2139 | | | |
| 2140 | | | } |
| 2141 | | | |
| 2142 | | | len = tvb_length_remaining(next_tvb, 0); |
| 2143 | | | |
| 2144 | | | for(i = 0; i < len; i++) |
| 2145 | | | if(!g_ascii_isprint(tvb_get_guint8(next_tvb, i)))
x /usr/include/glib-2.0/glib/gstrfuncs.h |
| |
75 | #define g_ascii_isprint(c) \ |
76 | ((g_ascii_table[(guchar) (c)] & G_ASCII_PRINT) != 0) |
| |
|
| 2146 | | | break; |
| 2147 | | | |
| 2148 | | | if(i == len) { |
Event 4:
Taking true branch. i == len evaluates to true.
hide
|
|
| 2149 | | | string = tvb_get_ephemeral_string(next_tvb, 0, tvb_length_remaining(next_tvb, 0)); |
| 2150 | | | |
| 2151 | | | |
| 2152 | | | proto_item_set_text(actx->created_item, "%s", string); |
| 2153 | | | |
| 2154 | | | } |
| 2155 | | | |
| 2156 | | | |
| 2157 | | | |
| 2158 | | | return offset; |
| 2159 | | | } |
| |