(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/profinet/packet-dcom-cba-acco.c) |
| |
| 2121 | | | dissect_ICBAAccoServerSRT_ConnectCR_rqst(tvbuff_t *tvb, int offset, |
| 2122 | | | packet_info *pinfo, proto_tree *tree, guint8 *drep) |
| 2123 | | | { |
| 2124 | | | gchar szCons[1000] = { 0 }; |
| 2125 | | | guint32 u32MaxConsLen = sizeof(szCons); |
| 2126 | | | guint16 u16QoSType; |
| 2127 | | | guint16 u16QoSValue; |
| 2128 | | | guint8 u8ConsMac[6]; |
| 2129 | | | guint16 u16CRID; |
| 2130 | | | guint16 u16CRLength; |
| 2131 | | | guint32 u32Flags; |
| 2132 | | | guint32 u32Count; |
| 2133 | | | guint32 u32ArraySize; |
| 2134 | | | guint32 u32Idx; |
| 2135 | | | proto_item *item = NULL; |
| 2136 | | | proto_tree *flags_tree = NULL; |
| 2137 | | | proto_item *sub_item; |
| 2138 | | | proto_tree *sub_tree; |
| 2139 | | | guint32 u32SubStart; |
| 2140 | | | dcerpc_info *info = (dcerpc_info *)pinfo->private_data; |
| 2141 | | | dcom_interface_t *cons_interf; |
| 2142 | | | cba_ldev_t *prov_ldev; |
| 2143 | | | cba_ldev_t *cons_ldev; |
| 2144 | | | cba_frame_t *frame; |
| 2145 | | | server_frame_call_t *call; |
| 2146 | | | |
| 2147 | | | |
| 2148 | | | offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep); |
| 2149 | | | |
| 2150 | | | |
| 2151 | | | prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid); |
| 2152 | | | |
| 2153 | | | item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE); |
Event 1:
!0 evaluates to true.
hide
|
|
| 2154 | | | PROTO_ITEM_SET_GENERATED(item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
Event 2:
item evaluates to false.
hide
|
|
| 2155 | | | pinfo->profinet_type = 4; |
| 2156 | | | |
| 2157 | | | |
| 2158 | | | offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep, |
| 2159 | | | hf_cba_acco_conn_consumer, szCons, u32MaxConsLen); |
| 2160 | | | |
| 2161 | | | |
| 2162 | | | cons_ldev = cba_acco_add(pinfo, szCons); |
| 2163 | | | |
| 2164 | | | offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep, |
| 2165 | | | hf_cba_acco_conn_qos_type, &u16QoSType); |
| 2166 | | | offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep, |
| 2167 | | | hf_cba_acco_conn_qos_value, &u16QoSValue); |
| 2168 | | | |
| 2169 | [+] | | offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, drep, 0, &cons_interf); |
 |
| 2170 | | | if(cons_interf == NULL) { |
Event 5:
Taking true branch. cons_interf == (void *)0 evaluates to true.
hide
|
|
| 2171 | | | expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, |
| 2172 | | | "ServerSRT_ConnectCR: consumer interface invalid"); |
| 2173 | | | } |
| 2174 | | | |
| 2175 | | | |
| 2176 | | | if(cons_interf != NULL && cons_ldev != NULL) { |
Event 6:
Skipping " if". cons_interf != (void *)0 evaluates to false.
hide
|
|
| 2177 | | | cba_ldev_link_acco(pinfo, cons_ldev, cons_interf); |
| 2178 | | | } |
| 2179 | | | |
| 2180 | | | |
| 2181 | | | tvb_memcpy(tvb, u8ConsMac, offset, 6); |
| 2182 | | | |
| 2183 | | | proto_tree_add_ether(tree, hf_cba_acco_serversrt_cons_mac, tvb, |
| 2184 | | | offset, 6, u8ConsMac); |
| 2185 | | | offset += 6; |
| 2186 | | | |
| 2187 | | | |
| 2188 | | | offset = dissect_dcom_DWORD(tvb, offset, pinfo, NULL , drep, |
| 2189 | | | 0 , &u32Flags); |
| 2190 | | | offset -= 4; |
| 2191 | | | item = proto_tree_add_uint_format_value(tree, hf_cba_acco_serversrt_cr_flags, |
| 2192 | | | tvb, offset, 4, u32Flags, |
| 2193 | | | "0x%02x (%s, %s)", u32Flags, |
| 2194 | | | (u32Flags & 0x2) ? "Reconfigure" : "not Reconfigure", |
Event 8:
u32Flags & 2 evaluates to false.
hide
|
|
| 2195 | | | (u32Flags & 0x1) ? "Timestamped" : "not Timestamped"); |
Event 7:
u32Flags & 1 evaluates to false.
hide
|
|
| 2196 | | | flags_tree = proto_item_add_subtree(item, ett_cba_acco_serversrt_cr_flags); |
| 2197 | | | proto_tree_add_boolean(flags_tree, hf_cba_acco_serversrt_cr_flags_reconfigure, tvb, offset, 4, u32Flags); |
| 2198 | | | proto_tree_add_boolean(flags_tree, hf_cba_acco_serversrt_cr_flags_timestamped, tvb, offset, 4, u32Flags); |
| 2199 | | | offset += 4; |
| 2200 | | | |
| 2201 | | | offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep, |
| 2202 | | | hf_cba_acco_count, &u32Count); |
| 2203 | | | |
| 2204 | | | offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep, |
| 2205 | [+] | | &u32ArraySize); |
 |
| 2206 | | | |
| 2207 | | | |
| 2208 | | | if(prov_ldev != NULL && cons_ldev != NULL && u32ArraySize < 100) { |
| 2209 | | | call = se_alloc(sizeof(server_frame_call_t) + u32ArraySize * sizeof(cba_frame_t *)); |
| 2210 | | | call->frame_count = 0; |
| 2211 | | | call->frames = (cba_frame_t **) (call+1); |
| 2212 | | | info->call_data->private_data = call; |
| 2213 | | | } else{ |
| 2214 | | | call = NULL; |
| 2215 | | | } |
| 2216 | | | |
| 2217 | | | u32Idx = 1; |
| 2218 | | | while (u32ArraySize--) { |
Event 16:
Leaving loop. u32ArraySize-- evaluates to false.
hide
|
|
| 2219 | | | |
| 2220 | | | sub_item = proto_tree_add_item(tree, hf_cba_connectincr, tvb, offset, 0, FALSE); |
| 2221 | | | sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectincr); |
| 2222 | | | u32SubStart = offset; |
| 2223 | | | |
| 2224 | | | offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep, |
| 2225 | | | hf_cba_acco_serversrt_cr_id, &u16CRID); |
| 2226 | | | |
| 2227 | | | offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep, |
| 2228 | | | hf_cba_acco_serversrt_cr_length, &u16CRLength); |
| 2229 2244 |  | | [ Lines 2229 to 2244 omitted. ] |
| 2245 | | | |
| 2246 | | | proto_item_append_text(sub_item, "[%u]: CRID=0x%x, CRLength=%u", |
| 2247 | | | u32Idx, u16CRID, u16CRLength); |
| 2248 | | | proto_item_set_len(sub_item, offset - u32SubStart); |
| 2249 | | | |
| 2250 | | | u32Idx++; |
| 2251 | | | } |
| 2252 | | | |
| 2253 | | | |
| 2254 | | | |
| 2255 | [+] | | if (check_col(pinfo->cinfo, COL_INFO)) { |
 |
| 2256 | | | col_append_fstr(pinfo->cinfo, COL_INFO, ": %sConsCRID=0x%x Len=%u QoS=%u", |
| 2257 | | | (u32Flags & 0x2) ? "Reco " : "", u16CRID, u16CRLength, u16QoSValue); |
Event 21:
u32Flags & 2 evaluates to true.
hide
Uninitialized Variable
u16CRLength was not initialized. The issue can occur if the highlighted code executes. Show: All events | Only primary events |
|
| |