Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Overrun  at packet-tpncp.c:506

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

fill_enums_id_vals

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-tpncp.c)expand/collapse
Show more  
 488  static gint fill_enums_id_vals(FILE *file) {
 489      gint i = 0, enum_id = 0, enum_val = 0, first_entry = 1;
 490      gchar *line_in_file = NULL, *enum_name = NULL,
 491             *enum_type = NULL, *enum_str = NULL;
 492   
 493[+]     line_in_file = ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
 494      line_in_file[0] = 0;
 495[+]     enum_name = ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
 496      enum_name[0] = 0;
 497      enum_type = ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
 498      enum_type[0] = 0;
 499      enum_str = ep_alloc(MAX_TPNCP_DB_ENTRY_LEN);
 500      enum_str[0] = 0;
 501   
 502      while (fgets(line_in_file, MAX_TPNCP_DB_ENTRY_LEN, file) != NULL) {
 503          if (!strncmp(line_in_file, "#####", 5)) {
 504              break;
 505          }
 506          if (sscanf(line_in_file, "%s %s %d", enum_name, enum_str, &enum_id) == 3) {
 507              if (strcmp(enum_type, enum_name)) {
 508                  if (!first_entry) {
 509                      if (enum_val < MAX_ENUMS_NUM) {
 510                          tpncp_enums_id_vals[enum_val][i].strptr = NULL;
 511                          tpncp_enums_id_vals[enum_val][i].value = 0;
 512                          enum_val++; i = 0;
 513                      }
 514                      else {
 515                          break;
 516                      }
 517                  }
 518                  else 
 519                      first_entry = 0;
 520                  tpncp_enums_name_vals[enum_val] = g_strdup(enum_name);
 521                  g_strlcpy(enum_type, enum_name, MAX_TPNCP_DB_ENTRY_LEN);
 522              }
 523              tpncp_enums_id_vals[enum_val][i].strptr = g_strdup(enum_str);
 524              tpncp_enums_id_vals[enum_val][i].value = enum_id;
 525              if (i < MAX_ENUM_ENTRIES) {
 526                  i++;
Show more  




Change Warning 3020.30227 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: