Project

General

Profile

Bug #1843

Updated by Victor Julien over 8 years ago

SCRealloc failed: Cannot allocate memory, while trying to allocate 18446744071562067968 bytes 

 in fuction SCACBSInitNewState 

 <pre> 
 static inline int SCACBSInitNewState(MpmCtx *mpm_ctx) 
 { 
     void *ptmp; 
     SCACBSCtx *ctx = (SCACBSCtx *)mpm_ctx->ctx; 
     int ascii_code = 0; 
     int size = 0; 

     /* reallocate space in the goto table to include a new state */ 
     size = (ctx->state_count + 1) * ctx->single_state_size; 
     ptmp = SCRealloc(ctx->goto_table, size); 

 //========================================================================== 
 </pre> 
 size is a int 
 but (ctx->state_count + 1) * ctx->single_state_size; is a unsigned int 
 when the size > 2G 
 size is overflow 

Back