Text   |  XML   |  ReML   |   Visible Warnings:

Cast Alters Value  at packet-ldap.c:3417

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

dissect_ldap_pdu

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ldap.c)expand/collapse
Show more  
 3347  dissect_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean is_mscldap)
 3348  {
 3349    int offset = 0;
 3350    conversation_t *conversation;
 3351    gboolean doing_sasl_security = FALSE;
 3352    guint length_remaining;
 3353    ldap_conv_info_t *ldap_info = NULL;
 3354    proto_item *ldap_item = NULL;
 3355    proto_tree *ldap_tree = NULL;
 3356   
 3357    ldm_tree = NULL;
 3358   
 3359    /*
 3360     * Do we have a conversation for this connection?
 3361     */
 3362    conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
 3363                                     pinfo->ptype, pinfo->srcport,
 3364[+]                                    pinfo->destport, 0);
 3365    if (conversation == NULL) {
 3366      /* We don't yet have a conversation, so create one. */
 3367      conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
 3368                                      pinfo->ptype, pinfo->srcport,
 3369                                      pinfo->destport, 0);
 3370   
 3371    }
 3372   
 3373    /*
 3374     * Do we already have a type and mechanism?
 3375     */
 3376[+]   ldap_info = conversation_get_proto_data(conversation, proto_ldap);
 3377    if (ldap_info == NULL) {
 3378      /* No.  Attach that information to the conversation, and add
 3379       * it to the list of information structures.
 3380       */
 3381      ldap_info = g_malloc(sizeof(ldap_conv_info_t));
 3382      ldap_info->auth_type = 0;
 3383      ldap_info->auth_mech = 0;
 3384      ldap_info->first_auth_frame = 0;
 3385      ldap_info->matched=g_hash_table_new(ldap_info_hash_matched, ldap_info_equal_matched);
 3386      ldap_info->unmatched=g_hash_table_new(ldap_info_hash_unmatched, ldap_info_equal_unmatched);
 3387      ldap_info->num_results = 0;
 3388      ldap_info->start_tls_frame = 0;
 3389      ldap_info->start_tls_pending = FALSE;
 3390   
 3391      conversation_add_proto_data(conversation, proto_ldap, ldap_info);
 3392   
 3393      ldap_info->next = ldap_info_items;
 3394      ldap_info_items = ldap_info;
 3395   
 3396    }
 3397     
 3398    switch (ldap_info->auth_type) {
 3399      case LDAP_AUTH_SASL:
 3400      /*
 3401       * It's SASL; are we using a security layer?
 3402       */
 3403      if (ldap_info->first_auth_frame != 0 &&
 3404         pinfo->fd->num >= ldap_info->first_auth_frame) {
 3405          doing_sasl_security = TRUE;     /* yes */
 3406      }
 3407    }
 3408   
 3409      length_remaining = tvb_ensure_length_remaining(tvb, offset);
 3410   
 3411      /* It might still be a packet containing a SASL security layer 
 3412       * but its just that we never saw the BIND packet.
 3413       * check if it looks like it could be a SASL blob here
 3414       * and in that case just assume it is GSS-SPNEGO
 3415       */
 3416[+]     if(!doing_sasl_security && (tvb_bytes_exist(tvb, offset, 5))
 3417[+]       &&(tvb_get_ntohl(tvb, offset)<=(guint)(tvb_reported_length_remaining(tvb, offset)-4))
Show more  




Change Warning 1290.35220 : Cast Alters Value

Priority:
State:
Finding:
Owner:
Note: