Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Overrun  at value_string.c:61

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

dissect_smb2_class_infolevel

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-smb2.c)expand/collapse
Show more  
 3085  dissect_smb2_class_infolevel(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree, smb2_info_t *si)
 3086  {
 3087          char cl, il;
 3088          proto_item *item;
 3089          int hfindex;
 3090          static const value_string dummy_value_string[] = {
 3091                  { 0, NULL }
 3092          };
 3093          const value_string *vs;
 3094   
 3095          if(si->flags & SMB2_FLAGS_RESPONSE){
 3096                  if(!si->saved){
 3097                          return offset;
 3098                  }
 3099                  cl=si->saved->class;
 3100                  il=si->saved->infolevel;
 3101          } else {
 3102                  cl=tvb_get_guint8(tvb, offset);
 3103                  il=tvb_get_guint8(tvb, offset+1);
 3104                  if(si->saved){
 3105                          si->saved->class=cl;
 3106                          si->saved->infolevel=il;
 3107                  }
 3108          }
 3109   
 3110   
 3111          switch(cl){
 3112          case SMB2_CLASS_FILE_INFO:
 3113                  hfindex=hf_smb2_infolevel_file_info;
 3114                  vs=smb2_file_info_levels;
 3115                  break;
 3116          case SMB2_CLASS_FS_INFO:
 3117                  hfindex=hf_smb2_infolevel_fs_info;
 3118                  vs=smb2_fs_info_levels;
 3119                  break;
 3120          case SMB2_CLASS_SEC_INFO:
 3121                  hfindex=hf_smb2_infolevel_sec_info;
 3122                  vs=smb2_sec_info_levels;
 3123                  break;
 3124          default:
 3125                  hfindex=hf_smb2_infolevel;
 3126                  vs=dummy_value_string;
 3127          }
 3128   
 3129   
 3130          /* class */
 3131          item=proto_tree_add_uint(tree, hf_smb2_class, tvb, offset, 1, cl);
 3132          if(si->flags & SMB2_FLAGS_RESPONSE){
 3133                  PROTO_ITEM_SET_GENERATED(item);
 3134          }
 3135          /* infolevel */
 3136          item=proto_tree_add_uint(tree, hfindex, tvb, offset+1, 1, il);
 3137          if(si->flags & SMB2_FLAGS_RESPONSE){
 3138                  PROTO_ITEM_SET_GENERATED(item);
 3139          }
 3140          offset += 2;
 3141   
 3142          if(!(si->flags & SMB2_FLAGS_RESPONSE)){
 3143                  /* Only update COL_INFO for requests. It clutters the 
 3144                   * display ab bit too much if we do it for replies 
 3145                   * as well.
 3146                   */
 3147[+]                 if (check_col(pinfo->cinfo, COL_INFO)){
 3148                          col_append_fstr(pinfo->cinfo, COL_INFO, " %s/%s",
 3149                                  val_to_str(cl, smb2_class_vals, "(Class:0x%02x)"),
 3150[+]                                 val_to_str(il, vs, "(Level:0x%02x)"));
expand/collapse

val_to_str

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/value_string.c)expand/collapse
Show more  
 39  const gchar*
 40  val_to_str(guint32 val, const value_string *vs, const char *fmt) {
 41    const gchar *ret;
 42   
 43    g_assert(fmt != NULL);
 44   
 45[+]   ret = match_strval(val, vs);
expand/collapse

match_strval

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/value_string.c)expand/collapse
Show more  
 75  const gchar*
 76  match_strval(guint32 val, const value_string *vs) {
 77      gint ignore_me;
 78[+]     return match_strval_idx(val, vs, &ignore_me);
expand/collapse

match_strval_idx

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/value_string.c)expand/collapse
Show more  
 56  const gchar*
 57  match_strval_idx(guint32 val, const value_string *vs, gint *idx) {
 58    gint i = 0;
 59   
 60    if(vs) {
 61      while (vs[i].strptr) {
 62        if (vs[i].value == val) {
 63          *idx = i;
 64          return(vs[i].strptr);
 65        }
 66        i++;
Show more  
Show more  
Show more  
Show more  




Change Warning 2985.31327 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: