(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ros.c) |
| |
| 193 | | | static gboolean ros_try_string(const char *oid, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
| 194 | | | { |
| 195 | | | ros_info_t *rinfo; |
| 196 | | | gint32 opcode = 0; |
| 197 | | | const gchar *opname = NULL; |
| 198 | | | const gchar *suffix = NULL; |
| 199 | | | int offset = 0; |
| 200 | | | new_dissector_t opdissector = NULL; |
| 201 | | | const value_string *lookup; |
| 202 | | | proto_item *item=NULL; |
| 203 | | | proto_tree *ros_tree=NULL; |
| 204 | | | |
| 205 | | | if((rinfo = (ros_info_t*)g_hash_table_lookup(protocol_table, oid)) != NULL) { |
| 206 | | | |
| 207 | | | if(tree){ |
| 208 | | | item = proto_tree_add_item(tree, *(rinfo->proto), tvb, 0, -1, FALSE); |
| 209 | | | ros_tree = proto_item_add_subtree(item, *(rinfo->ett_proto)); |
| 210 | | | } |
| 211 | | | |
| 212 | | | if (check_col(pinfo->cinfo, COL_PROTOCOL)) |
| 213 | | | col_set_str(pinfo->cinfo, COL_PROTOCOL, rinfo->name); |
| 214 | | | |
| 215 | | | |
| 216 | | | if((session->ros_op & ROS_OP_TYPE_MASK) == ROS_OP_BIND) { |
| 217 | | | |
| 218 | | | if((session->ros_op & ROS_OP_PDU_MASK) == ROS_OP_ERROR) |
| 219 | | | opcode = err_ros_bind;
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ros.h |
| |
72 | # define err_ros_bind (-1) /* pseudo eror code for asn2wrs generated binds */ |
| |
|
| 220 | | | else |
| 221 | | | opcode = op_ros_bind;
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ros.h |
| |
71 | # define op_ros_bind (-1) /* pseudo operation code for asn2wrs generated binds */ |
| |
|
| 222 | | | } else |
| 223 | | | |
| 224 | | | opcode = session->ros_op & ROS_OP_OPCODE_MASK; |
| 225 | | | |
| 226 | | | |
| 227 | | | lookup = rinfo->opr_code_strings; |
| 228 | | | |
| 229 | | | switch(session->ros_op & ROS_OP_PDU_MASK) { |
| 230 | | | case ROS_OP_ARGUMENT: |
| 231 | | | opdissector = ros_lookup_opr_dissector(opcode, rinfo->opr_code_dissectors, TRUE); |
| 232 | | | suffix = "_argument"; |
| 233 | | | break; |
| 234 | | | case ROS_OP_RESULT: |
| 235 | | | opdissector = ros_lookup_opr_dissector(opcode, rinfo->opr_code_dissectors, FALSE); |
| 236 | | | suffix = "_result"; |
| 237 | | | break; |
| 238 | | | case ROS_OP_ERROR: |
| 239 | | | opdissector = ros_lookup_err_dissector(opcode, rinfo->err_code_dissectors); |
| 240 | | | lookup = rinfo->err_code_strings; |
| 241 | | | break; |
| 242 | | | default: |
| 243 | | | break; |
| 244 | | | } |
| 245 | | | |
| 246 | | | if(opdissector) { |
| 247 | | | |
| 248 | | | opname = val_to_str(opcode, lookup, "Unknown opcode (%d)"); |
Ignored Return Value
The return value of val_to_str() 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 val_to_str() 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 val_to_str() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 249 | | | |
| 250 | | | if (check_col(pinfo->cinfo, COL_INFO)) { |
Event 2:
Skipping " if". check_col(...) evaluates to false.
hide
|
|
| 251 | | | col_set_str(pinfo->cinfo, COL_INFO, opname); |
| 252 | | | if(suffix) |
| 253 | | | col_append_str(pinfo->cinfo, COL_INFO, suffix); |
| 254 | | | } |
| 255 | | | |
| 256 | | | offset = (*opdissector)(tvb, pinfo, ros_tree); |
| 257 | | | |
| 258 | | | return TRUE; |
Event 3:
!0 evaluates to true.
hide
|
|
| 259 | | | } |
| 260 | | | } |
| 261 | | | |
| 262 | | | return FALSE; |
| 263 | | | } |
| |