(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ldap.c) |
| |
| 4206 | | | dissect_ldap_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
| 4207 | | | { |
| 4208 | | | guint32 sasl_len; |
| 4209 | | | guint32 ldap_len; |
| 4210 | | | int offset; |
| 4211 | | | gboolean ind; |
| 4212 | | | conversation_t *conversation; |
| 4213 | | | ldap_conv_info_t *ldap_info = NULL; |
| 4214 | | | |
| 4215 | | | |
| 4216 | | | |
| 4217 | | | |
| 4218 | | | conversation = find_conversation(pinfo->fd->num, |
| 4219 | | | &pinfo->src, &pinfo->dst, |
| 4220 | | | pinfo->ptype, pinfo->srcport, |
| 4221 | | | pinfo->destport, 0); |
| 4222 | | | if(conversation){ |
| 4223 | | | ldap_info = conversation_get_proto_data(conversation, proto_ldap); |
Ignored Return Value
The return value of conversation_get_proto_data() 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 conversation_get_proto_data() is checked 99% 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 conversation_get_proto_data() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 4224 | | | } |
| 4225 | | | |
| 4226 | | | ldm_tree = NULL; |
| 4227 | | | |
| 4228 | | | |
| 4229 | | | |
| 4230 | | | |
| 4231 | | | |
| 4232 | | | |
| 4233 | | | |
| 4234 | | | |
| 4235 | | | |
| 4236 | | | |
| 4237 | | | |
| 4238 | | | |
| 4239 | | | |
| 4240 | | | |
| 4241 | | | |
| 4242 | | | |
| 4243 | | | |
| 4244 | | | |
| 4245 | | | |
| 4246 | | | sasl_len=tvb_get_ntohl(tvb, 0); |
| 4247 | | | |
| 4248 | | | if( sasl_len<2 ){ |
Event 2:
Skipping " if". sasl_len < 2 evaluates to false.
hide
|
|
| 4249 | | | goto this_was_not_sasl; |
| 4250 | | | } |
| 4251 | | | |
| 4252 | | | if( sasl_len>LDAP_SASL_MAX_BUF ){ |
Event 3:
Taking true branch. sasl_len > 4 * 64 * 1024 evaluates to true.
hide
|
|
| 4253 | | | goto this_was_not_sasl; |
| 4254 | | | } |
| 4255 | | | |
| 4256 | | | if((!ldap_info) || (ldap_info->auth_type!=LDAP_AUTH_SASL) ){ |
| 4257 | | | goto this_was_not_sasl; |
| 4258 | | | } |
| 4259 | | | |
| 4260 | | | tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_sasl_ldap_pdu_len, dissect_sasl_ldap_pdu); |
| 4261 | | | return; |
| 4262 | | | |
| 4263 | | | this_was_not_sasl: |
| 4264 | | | |
| 4265 | | | |
| 4266 | | | |
| 4267 | | | |
| 4268 | | | |
| 4269 | | | if(tvb_get_guint8(tvb, 0)!=0x30){ |
Event 4:
Skipping " if". tvb_get_guint8(tvb, 0) != 48 evaluates to false.
hide
|
|
| 4270 | | | goto this_was_not_normal_ldap; |
| 4271 | | | } |
| 4272 | | | |
| 4273 | | | |
| 4274 | | | offset=get_ber_length(tvb, 1, &ldap_len, &ind); |
| 4275 | | | |
| 4276 | | | |
| 4277 | | | if(ldap_len<2){ |
Event 5:
Skipping " if". ldap_len < 2 evaluates to false.
hide
|
|
| 4278 | | | goto this_was_not_normal_ldap; |
| 4279 | | | } |
| 4280 | | | |
| 4281 | | | tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_normal_ldap_pdu_len, dissect_normal_ldap_pdu); |
| 4282 | | | |
| 4283 | | | goto end; |
| 4284 | | | |
| 4285 | | | this_was_not_normal_ldap: |
| 4286 | | | |
| 4287 | | | |
| 4288 | | | if(ldap_info && |
| 4289 | | | ldap_info->start_tls_frame && |
| 4290 | | | ( pinfo->fd->num >= ldap_info->start_tls_frame)) { |
| 4291 | | | |
| 4292 | | | |
| 4293 | | | guint32 old_start_tls_frame; |
| 4294 | | | |
| 4295 | | | |
| 4296 | | | dissector_delete("tcp.port", tcp_port, ldap_handle); |
| 4297 | | | ssl_dissector_add(tcp_port, "ldap", TRUE); |
| 4298 | | | |
| 4299 | | | old_start_tls_frame = ldap_info->start_tls_frame; |
| 4300 | | | ldap_info->start_tls_frame = 0; |
| 4301 | | | pinfo->can_desegment++; |
| 4302 | | | |
| 4303 | | | offset = call_dissector(ssl_handle, tvb, pinfo, tree); |
| 4304 | | | |
| 4305 | | | ldap_info->start_tls_frame = old_start_tls_frame; |
| 4306 | | | ssl_dissector_delete(tcp_port, "ldap", TRUE); |
| 4307 | | | |
| 4308 | | | |
| 4309 | | | dissector_add("tcp.port", tcp_port, ldap_handle); |
| 4310 | | | |
| 4311 | | | |
| 4312 | | | return; |
| 4313 | | | } |
| 4314 | | | end: |
| 4315 | | | return; |
| 4316 | | | } |
| |