Text   |  XML   |  ReML   |   Visible Warnings:

Unreasonable Size Argument  at packet-ldap.c:703

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

dissect_ldap_AssertionValue

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ldap.c)expand/collapse
Show more  
 606  dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index)
 607  {
 608          gint8 class;
 609          gboolean pc, ind, is_ascii;
 610          gint32 tag;
 611          guint32 len, i;
 612          const guchar *str;
 613   
 614          if(!implicit_tag){
 615                  offset=get_ber_identifier(tvb, offset, &class, &pc, &tag);
 616                  offset=get_ber_length(tvb, offset, &len, &ind);
 617          } else {
 618[+]                 len=tvb_length_remaining(tvb,offset);
 619          }
 620   
 621          if(len==0){
 622                  return offset;
 623          }
 624   
 625   
 626          /*
 627           * Some special/wellknown attributes in common LDAP (read AD)
 628           * are neither ascii strings nor blobs of hex data.
 629           * Special case these attributes and decode them more nicely.
 630           *
 631           * Add more special cases as required to prettify further 
 632           * (there cant be that many ones that are truly interesting)
 633           */
 634          if(attributedesc_string && !strncmp("DomainSid", attributedesc_string, 9)){
 635                  tvbuff_t *sid_tvb;
 636                  char *tmpstr;
 637   
 638                  /* this octet string contains an NT SID */
 639                  sid_tvb=tvb_new_subset(tvb, offset, len, len);
 640                  dissect_nt_sid(sid_tvb, 0, tree, "SID", &tmpstr, hf_index);
 641                  ldapvalue_string=tmpstr;
 642   
 643                  goto finished;
 644          } else if ( (len==16) /* GUIDs are always 16 bytes */
 645          && (attributedesc_string && !strncmp("DomainGuid", attributedesc_string, 10))) {
 646                  guint8 drep[4] = { 0x10, 0x00, 0x00, 0x00}; /* fake DREP struct */
 647                  e_uuid_t uuid;
 648   
 649                  /* This octet string contained a GUID */
 650                  dissect_dcerpc_uuid_t(tvb, offset, actx->pinfo, tree, drep, hf_ldap_guid, &uuid);
 651   
 652                  ldapvalue_string=ep_alloc(1024);
 653                  g_snprintf(ldapvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
 654                            uuid.Data1, uuid.Data2, uuid.Data3,
 655                            uuid.Data4[0], uuid.Data4[1],
 656                            uuid.Data4[2], uuid.Data4[3],
 657                            uuid.Data4[4], uuid.Data4[5],
 658                            uuid.Data4[6], uuid.Data4[7]);
 659   
 660                  goto finished;
 661          } else if (attributedesc_string && !strncmp("NtVer", attributedesc_string, 5)){
 662                  guint32 flags;
 663   
 664                  len = 0;
 665                  /* get flag value to populate ldapvalue_string */
 666                  flags=tvb_get_letohl(tvb, offset);
 667                   
 668                  ldapvalue_string=ep_alloc(1024);
 669                  g_snprintf(ldapvalue_string, 1023, "0x%08x",flags);
 670   
 671                  /* populate bitmask subtree */
 672                  offset = dissect_mscldap_ntver_flags(tree, tvb, offset);
 673   
 674                  goto finished;
 675   
 676   
 677          }
 678   
 679          /*
 680           * It was not one of our "wellknown" attributes so make the best 
 681           * we can and just try to see if it is an ascii string or if it
 682           * is a binary blob.
 683           *
 684           * XXX - should we support reading RFC 2252-style schemas 
 685           * for LDAP, and using that to determine how to display
 686           * attribute values and assertion values?
 687           *
 688           * -- I dont think there are full schemas available that describe the 
 689           *  interesting cases i.e. AD -- ronnie 
 690           */
 691          str=tvb_get_ptr(tvb, offset, len);
 692          is_ascii=TRUE;
 693          for(i=0;i<len;i++){
 694                  if(!isascii(str[i]) || !isprint(str[i])){
 695                          is_ascii=FALSE;
 696                          break;
 697                  }
 698          }
 699   
 700          /* convert the string into a printable string */
 701          if(is_ascii){
 702                  ldapvalue_string=ep_alloc(len+1);
 703                  memcpy(ldapvalue_string,str,len);
Show more  




Change Warning 1287.32997 : Unreasonable Size Argument

Priority:
State:
Finding:
Owner:
Note: