Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at packet-bootp.c:4032

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

bootp_init_protocol

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-bootp.c)expand/collapse
Show more  
 4004  bootp_init_protocol(void)
 4005  {
 4006      gchar **optionstrings = NULL;
 4007      gchar **optiondetail = NULL;
 4008      gchar *type = NULL;
 4009      guint i, ii;
 4010   
 4011      /* first copy default_bootp_opt[] to bootp_opt[].  This resets all values to default */
 4012      for(i=0; i<BOOTP_OPT_NUM; i++)
 4013      {
 4014          bootp_opt[i].text = default_bootp_opt[i].text;
 4015          bootp_opt[i].ftype = default_bootp_opt[i].ftype;
 4016          bootp_opt[i].data = default_bootp_opt[i].data;
 4017      }
 4018   
 4019      /* now split semicolon seperated fields groups */
 4020      optionstrings = ep_strsplit(pref_optionstring, ";", -1);
 4021      for (i=0;optionstrings[i]!=NULL;i++)
 4022      {
 4023          /* input string should have 3 fields:
 4024             1 - bootp option - uint8 1-254, not being a special
 4025             2 - option name - string 
 4026             3 - option type - defined in enum represented as a string 
 4027          */
 4028   
 4029          /* now split field groups to usable data */
 4030[+]         optiondetail = ep_strsplit(optionstrings[i], ",",-1);
 4031          /* verify array has 3 or more entries, any entries beyond 3 are ingnored */
 4032          for(ii=0;(optiondetail[ii]!=NULL);ii++)
 4033          {
 4034              /* do nothing */
 4035          }
 4036          if (ii < 3) continue;                            /* not enough values.  Go again              */
 4037          ii = atoi(optiondetail[0]);                      /* get the bootp option number               */
 4038          if (ii==0 || ii>=BOOTP_OPT_NUM-1) continue;      /* not a number or out of range.  Go again   */
 4039          if (bootp_opt[ii].ftype == special) continue;    /* don't mess with specials.  Go again       */
 4040          bootp_opt[ii].text = se_strdup(optiondetail[1]); /* store a permanent ("seasonal") copy       */
 4041          type = optiondetail[2];                          /* A string to be converted to an ftype enum */
 4042          /* XXX This if statement could be extended to allow for additinonal types */
 4043          if (g_ascii_strcasecmp(type,"string") == 0)
 4044          {
 4045              bootp_opt[ii].ftype = string;
 4046          } else if (g_ascii_strcasecmp(type,"ipv4") == 0)
 4047          {
 4048              bootp_opt[ii].ftype = ipv4;
 4049          } else if (g_ascii_strcasecmp(type,"bytes") == 0)
 4050          {
 4051              bootp_opt[ii].ftype = bytes;
 4052          } else 
 4053          {
 4054              bootp_opt[ii].ftype = opaque;
Show more  




Change Warning 1932.30706 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: