(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/oids.c) |
| |
| 1013 | | | const gchar *oid_resolved(guint32 num_subids, guint32* subids) { |
| 1014 | | | guint matched; |
| 1015 | | | guint left; |
| 1016 | | | oid_info_t* oid; |
| 1017 | | | |
| 1018 | | | if(! (subids && *subids <= 2 )) |
| 1019 | | | return "*** Malformed OID ***"; |
| 1020 | | | |
| 1021 | | | oid = oid_get(num_subids, subids, &matched, &left); |
| 1022 | | | |
| 1023 | | | while (! oid->name ) { |
| 1024 | | | if (!(oid = oid->parent)) { |
| 1025 | | | return oid_subid2string(subids,num_subids); |
| 1026 | | | } |
| 1027 | | | left++; |
| 1028 | | | matched--; |
| 1029 | | | } |
| 1030 | | | |
| 1031 | | | if (left) { |
| 1032 | | | return ep_strdup_printf("%s.%s", |
| 1033 | | | oid->name ? oid->name : oid_subid2string(subids,matched), |
| 1034 | | | oid_subid2string(&(subids[matched]),left)); |
| 1035 | | | } else { |
| 1036 | | | return oid->name ? oid->name : oid_subid2string(subids,matched); |
Redundant Condition
oid->name always evaluates to true. This may be because: - There is a constant assignment to one or more of the variables involved.
- An earlier conditional statement has already ensured that oid->name cannot be false.
- A crashing bug occurs on every path where oid->name could have evaluated to false. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 1037 | | | } |
| 1038 | | | } |
| |