Text   |  XML   |  ReML   |   Visible Warnings:

Integer Overflow of Allocation Size  at wimaxasncp_dict.c:1939

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

yy_get_next_buffer

(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/wimaxasncp/wimaxasncp_dict.c)expand/collapse
Show more  
 1874  static int yy_get_next_buffer (void)
 1875  {
 1876          register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
 1877          register char *source = (yytext_ptr);
 1878          register int number_to_move, i;
 1879          int ret_val;
 1880   
 1881          if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
 1882                  YY_FATAL_ERROR(
 1883                  "fatal flex scanner internal error--end of buffer missed" );
 1884   
 1885          if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
 1886                  { /* Don't try to fill the buffer, so this is an EOF. */
 1887                  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
 1888                          {
 1889                          /* We matched a single character, the EOB, so 
 1890                           * treat this as a final EOF.
 1891                           */
 1892                          return EOB_ACT_END_OF_FILE;
 1893                          }
 1894   
 1895                  else 
 1896                          {
 1897                          /* We matched some text prior to the EOB, first 
 1898                           * process it.
 1899                           */
 1900                          return EOB_ACT_LAST_MATCH;
 1901                          }
 1902                  }
 1903   
 1904          /* Try to read more data. */
 1905   
 1906          /* First move last chars to start of buffer. */
 1907          number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
 1908   
 1909          for ( i = 0; i < number_to_move; ++i )
 1910                  *(dest++) = *(source++);
 1911   
 1912          if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
 1913                  /* don't do the read, it's not guaranteed to return an EOF,
 1914                   * just force an EOF
 1915                   */
 1916                  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
 1917   
 1918          else 
 1919                  {
 1920                          int num_to_read =
 1921                          YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 1922   
 1923                  while ( num_to_read <= 0 )
 1924                          { /* Not enough room in the buffer - grow it. */
 1925   
 1926                          /* just a shorter name for the current buffer */
 1927                          YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
 1928   
 1929                          int yy_c_buf_p_offset =
 1930                                  (int) ((yy_c_buf_p) - b->yy_ch_buf);
 1931   
 1932                          if ( b->yy_is_our_buffer )
 1933                                  {
 1934                                  int new_size = b->yy_buf_size * 2;
 1935   
 1936                                  if ( new_size <= 0 )
 1937                                          b->yy_buf_size += b->yy_buf_size / 8;
 1938                                  else 
 1939                                          b->yy_buf_size *= 2;
 1940   
 1941                                  b->yy_ch_buf = (char *)
 1942                                          /* Include room in for 2 EOB chars. */
 1943[+]                                         WimaxasncpDictrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
expand/collapse

WimaxasncpDictrealloc

(/home/sate/Testcases/c/cve/wireshark-1.2.0/plugins/wimaxasncp/wimaxasncp_dict.c)expand/collapse
Show more  
 2717  void *WimaxasncpDictrealloc  (void * ptr, yy_size_t  size )
 2718  {
 2719          /* The cast to (char *) in the following accommodates both 
 2720           * implementations that use char* generic pointers, and those
 2721           * that use void* generic pointers.  It works with the latter
 2722           * because both ANSI C and C++ allow castless assignment from
 2723           * any pointer type to void*, and deal with argument conversions 
 2724           * as though doing an assignment.
 2725           */
 2726          return (void *) realloc( (char *) ptr, size );
Show more  
Show more  




Change Warning 3926.30272 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: