Text   |  XML   |  ReML   |   Visible Warnings:

Integer Overflow of Allocation Size  at ascend-scanner.c:1834

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/wiretap/ascend-scanner.c)expand/collapse
Show more  
 1769  static int yy_get_next_buffer (void)
 1770  {
 1771          register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
 1772          register char *source = (yytext_ptr);
 1773          register int number_to_move, i;
 1774          int ret_val;
 1775   
 1776          if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
 1777                  YY_FATAL_ERROR(
 1778                  "fatal flex scanner internal error--end of buffer missed" );
 1779   
 1780          if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
 1781                  { /* Don't try to fill the buffer, so this is an EOF. */
 1782                  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
 1783                          {
 1784                          /* We matched a single character, the EOB, so 
 1785                           * treat this as a final EOF.
 1786                           */
 1787                          return EOB_ACT_END_OF_FILE;
 1788                          }
 1789   
 1790                  else 
 1791                          {
 1792                          /* We matched some text prior to the EOB, first 
 1793                           * process it.
 1794                           */
 1795                          return EOB_ACT_LAST_MATCH;
 1796                          }
 1797                  }
 1798   
 1799          /* Try to read more data. */
 1800   
 1801          /* First move last chars to start of buffer. */
 1802          number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
 1803   
 1804          for ( i = 0; i < number_to_move; ++i )
 1805                  *(dest++) = *(source++);
 1806   
 1807          if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
 1808                  /* don't do the read, it's not guaranteed to return an EOF,
 1809                   * just force an EOF
 1810                   */
 1811                  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
 1812   
 1813          else 
 1814                  {
 1815                          int num_to_read =
 1816                          YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 1817   
 1818                  while ( num_to_read <= 0 )
 1819                          { /* Not enough room in the buffer - grow it. */
 1820   
 1821                          /* just a shorter name for the current buffer */
 1822                          YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
 1823   
 1824                          int yy_c_buf_p_offset =
 1825                                  (int) ((yy_c_buf_p) - b->yy_ch_buf);
 1826   
 1827                          if ( b->yy_is_our_buffer )
 1828                                  {
 1829                                  int new_size = b->yy_buf_size * 2;
 1830   
 1831                                  if ( new_size <= 0 )
 1832                                          b->yy_buf_size += b->yy_buf_size / 8;
 1833                                  else 
 1834                                          b->yy_buf_size *= 2;
 1835   
 1836                                  b->yy_ch_buf = (char *)
 1837                                          /* Include room in for 2 EOB chars. */
 1838[+]                                         ascendrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
expand/collapse

ascendrealloc

(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/ascend-scanner.c)expand/collapse
Show more  
 2604  void *ascendrealloc  (void * ptr, yy_size_t  size )
 2605  {
 2606          /* The cast to (char *) in the following accommodates both 
 2607           * implementations that use char* generic pointers, and those
 2608           * that use void* generic pointers.  It works with the latter
 2609           * because both ANSI C and C++ allow castless assignment from
 2610           * any pointer type to void*, and deal with argument conversions 
 2611           * as though doing an assignment.
 2612           */
 2613          return (void *) realloc( (char *) ptr, size );
Show more  
Show more  




Change Warning 959.30263 : Integer Overflow of Allocation Size

Priority:
State:
Finding:
Owner:
Note: