Text   |  XML   |  ReML   |   Visible Warnings:

Integer Overflow of Allocation Size  at lemon.c:3466

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

print_stack_union

(/home/sate/Testcases/c/cve/wireshark-1.2.0/tools/lemon/lemon.c)expand/collapse
Show more  
 3436  PRIVATE void print_stack_union(
 3437      FILE *out,              /* The output stream */
 3438      struct lemon *lemp,     /* The main info structure for this parser */
 3439      int *plineno,           /* Pointer to the line number */
 3440      int mhflag)             /* True if generating makeheaders output */
 3441  {
 3442    int lineno = *plineno;    /* The line number of the output */
 3443    char **types;             /* A hash table of datatypes */
 3444    int arraysize;            /* Size of the "types" array */
 3445    int maxdtlength;          /* Maximum length of any ".datatype" field. */
 3446    char *stddt;              /* Standardized name for a datatype */
 3447    int i,j;                  /* Loop counters */
 3448    int hash;                 /* For hashing the name of a type */
 3449    const char *name;         /* Name of the parser */
 3450   
 3451    /* Allocate and initialize types[] and allocate stddt[] */
 3452    arraysize = lemp->nsymbol * 2;
 3453    types = (char**)calloc( arraysize, sizeof(char*) );
 3454    for(i=0; i<arraysize; i++) types[i] = 0;
 3455    maxdtlength = 0;
 3456    if( lemp->vartype ){
 3457      maxdtlength = (int) strlen(lemp->vartype);
 3458    }
 3459    for(i=0; i<lemp->nsymbol; i++){
 3460      int len;
 3461      struct symbol *sp = lemp->symbols[i];
 3462      if( sp->datatype==0 ) continue;
 3463      len = (int) strlen(sp->datatype);
 3464      if( len>maxdtlength ) maxdtlength = len;
 3465    }
 3466    stddt = (char*)malloc( maxdtlength*2 + 1 );
Show more  




Change Warning 919.29943 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: