(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-h248.c) |
| |
| 1167 | | | extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo , int hfid _U_, h248_curr_info_t* u1 _U_, void* u2 _U_) { |
| 1168 | | | tvbuff_t *new_tvb = NULL; |
| 1169 | | | proto_tree *package_tree=NULL; |
| 1170 | | | guint16 name_major, name_minor; |
| 1171 | | | int old_offset; |
| 1172 | | | const h248_package_t* pkg = NULL; |
| 1173 | | | guint i; |
| 1174 | | | int offset = 0; |
| 1175 | | | asn1_ctx_t asn1_ctx; |
| 1176 | | | asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); |
| 1177 | | | |
| 1178 | | | old_offset=offset; |
| 1179 | | | offset = dissect_ber_octet_string(FALSE, &asn1_ctx, tree, tvb, offset, hfid , &new_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 |
|
| 1180 | | | |
| 1181 | | | if (new_tvb) { |
Event 2:
Taking true branch. new_tvb evaluates to true.
hide
|
|
| 1182 | | | |
| 1183 | | | name_major=tvb_get_ntohs(new_tvb, 0); |
| 1184 | | | name_minor=tvb_get_ntohs(new_tvb, 2); |
| 1185 | | | |
| 1186 | | | |
| 1187 | | | proto_item_append_text(asn1_ctx.created_item, " %s (%04x)", val_to_str(name_major, package_name_vals, "Unknown Package"), name_major); |
| 1188 | | | |
| 1189 | | | if(tree){ |
Event 3:
Skipping " if". tree evaluates to false.
hide
|
|
| 1190 | | | proto_item* pi; |
| 1191 | | | const gchar* strval; |
| 1192 | | | |
| 1193 | | | package_tree = proto_item_add_subtree(asn1_ctx.created_item, ett_packagename); |
| 1194 | | | proto_tree_add_uint(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major); |
| 1195 | | | |
| 1196 | | | for(i=0; i < packages->len; i++) { |
| 1197 | | | pkg = g_ptr_array_index(packages,i);
x /usr/include/glib-2.0/glib/garray.h |
| |
111 | #define g_ptr_array_index(array,index_) ((array)->pdata)[index_] |
| |
|
| 1198 | | | |
| 1199 | | | if (name_major == pkg->id) { |
| 1200 | | | break; |
| 1201 | | | } else { |
| 1202 | | | pkg = NULL; |
| 1203 | | | } |
| 1204 | | | } |
| 1205 | | | |
| 1206 | | | if (! pkg ) pkg = &no_package; |
| 1207 | | | |
| 1208 | | | |
| 1209 | | | pi = proto_tree_add_uint(package_tree, hf_248_pkg_param, tvb, offset-2, 2, name_minor); |
| 1210 | | | |
| 1211 | | | if (pkg->signal_names && ( strval = match_strval(name_minor, pkg->signal_names) )) { |
| 1212 | | | strval = ep_strdup_printf("%s (%d)",strval,name_minor); |
| 1213 | | | } else { |
| 1214 | | | strval = ep_strdup_printf("Unknown (%d)",name_minor); |
| 1215 | | | } |
| 1216 | | | |
| 1217 | | | proto_item_set_text(pi,"Signal ID: %s", strval); |
| 1218 | | | } |
| 1219 | | | |
| 1220 | | | } |
| 1221 | | | } |
| |