idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
6,200
static inline struct h2s *h2c_st_by_id(struct h2c *h2c, int id) { struct eb32_node *node; if (id > h2c->max_id) return (struct h2s *)h2_idle_stream; node = eb32_lookup(&h2c->streams_by_id, id); if (!node) return (struct h2s *)h2_closed_stream; return container_of(node, struct h2s, by_id); }
Exec Code Overflow
0
static inline struct h2s *h2c_st_by_id(struct h2c *h2c, int id) { struct eb32_node *node; if (id > h2c->max_id) return (struct h2s *)h2_idle_stream; node = eb32_lookup(&h2c->streams_by_id, id); if (!node) return (struct h2s *)h2_closed_stream; return container_of(node, struct h2s, by_id); }
@@ -1735,7 +1735,7 @@ static void h2_process_demux(struct h2c *h2c) goto fail; } - if ((int)hdr.len < 0 || (int)hdr.len > h2c->mfs) { + if ((int)hdr.len < 0 || (int)hdr.len > global.tune.bufsize) { ...
CWE-119
null
null
6,201
static struct h2s *h2c_stream_new(struct h2c *h2c, int id) { struct conn_stream *cs; struct h2s *h2s; h2s = pool_alloc(pool_head_h2s); if (!h2s) goto out; h2s->h2c = h2c; h2s->mws = h2c->miw; h2s->flags = H2_SF_NONE; h2s->errcode = H2_ERR_NO_ERROR; h2s->st = H2_SS_IDLE; h1m_init(&...
Exec Code Overflow
0
static struct h2s *h2c_stream_new(struct h2c *h2c, int id) { struct conn_stream *cs; struct h2s *h2s; h2s = pool_alloc(pool_head_h2s); if (!h2s) goto out; h2s->h2c = h2c; h2s->mws = h2c->miw; h2s->flags = H2_SF_NONE; h2s->errcode = H2_ERR_NO_ERROR; h2s->st = H2_SS_IDLE; h1m_init(&...
@@ -1735,7 +1735,7 @@ static void h2_process_demux(struct h2c *h2c) goto fail; } - if ((int)hdr.len < 0 || (int)hdr.len > h2c->mfs) { + if ((int)hdr.len < 0 || (int)hdr.len > global.tune.bufsize) { ...
CWE-119
null
null
6,202
static void h2c_update_all_ws(struct h2c *h2c, int diff) { struct h2s *h2s; struct eb32_node *node; if (!diff) return; node = eb32_first(&h2c->streams_by_id); while (node) { h2s = container_of(node, struct h2s, by_id); h2s->mws += diff; node = eb32_next(node); } }
Exec Code Overflow
0
static void h2c_update_all_ws(struct h2c *h2c, int diff) { struct h2s *h2s; struct eb32_node *node; if (!diff) return; node = eb32_first(&h2c->streams_by_id); while (node) { h2s = container_of(node, struct h2s, by_id); h2s->mws += diff; node = eb32_next(node); } }
@@ -1735,7 +1735,7 @@ static void h2_process_demux(struct h2c *h2c) goto fail; } - if ((int)hdr.len < 0 || (int)hdr.len > h2c->mfs) { + if ((int)hdr.len < 0 || (int)hdr.len > global.tune.bufsize) { ...
CWE-119
null
null
6,203
static int h2s_frt_make_resp_data(struct h2s *h2s, struct buffer *buf) { struct h2c *h2c = h2s->h2c; struct h1m *h1m = &h2s->res; struct chunk outbuf; int ret = 0; int total = 0; int es_now = 0; int size = 0; char *blk1, *blk2; int len1, len2; if (h2c_mux_busy(h2c, h2s)) { h2s->flags |= H2_SF_BLK_MBUSY; ...
Exec Code Overflow
0
static int h2s_frt_make_resp_data(struct h2s *h2s, struct buffer *buf) { struct h2c *h2c = h2s->h2c; struct h1m *h1m = &h2s->res; struct chunk outbuf; int ret = 0; int total = 0; int es_now = 0; int size = 0; char *blk1, *blk2; int len1, len2; if (h2c_mux_busy(h2c, h2s)) { h2s->flags |= H2_SF_BLK_MBUSY; ...
@@ -1735,7 +1735,7 @@ static void h2_process_demux(struct h2c *h2c) goto fail; } - if ((int)hdr.len < 0 || (int)hdr.len > h2c->mfs) { + if ((int)hdr.len < 0 || (int)hdr.len > global.tune.bufsize) { ...
CWE-119
null
null
6,204
static int h2s_frt_make_resp_headers(struct h2s *h2s, struct buffer *buf) { struct http_hdr list[MAX_HTTP_HDR]; struct h2c *h2c = h2s->h2c; struct h1m *h1m = &h2s->res; struct chunk outbuf; int es_now = 0; int ret = 0; int hdr; if (h2c_mux_busy(h2c, h2s)) { h2s->flags |= H2_SF_BLK_MBUSY; return 0; } if ...
Exec Code Overflow
0
static int h2s_frt_make_resp_headers(struct h2s *h2s, struct buffer *buf) { struct http_hdr list[MAX_HTTP_HDR]; struct h2c *h2c = h2s->h2c; struct h1m *h1m = &h2s->res; struct chunk outbuf; int es_now = 0; int ret = 0; int hdr; if (h2c_mux_busy(h2c, h2s)) { h2s->flags |= H2_SF_BLK_MBUSY; return 0; } if ...
@@ -1735,7 +1735,7 @@ static void h2_process_demux(struct h2c *h2c) goto fail; } - if ((int)hdr.len < 0 || (int)hdr.len > h2c->mfs) { + if ((int)hdr.len < 0 || (int)hdr.len > global.tune.bufsize) { ...
CWE-119
null
null
6,205
static inline __maybe_unused int h2s_id(const struct h2s *h2s) { return h2s ? h2s->id : 0; }
Exec Code Overflow
0
static inline __maybe_unused int h2s_id(const struct h2s *h2s) { return h2s ? h2s->id : 0; }
@@ -1735,7 +1735,7 @@ static void h2_process_demux(struct h2c *h2c) goto fail; } - if ((int)hdr.len < 0 || (int)hdr.len > h2c->mfs) { + if ((int)hdr.len < 0 || (int)hdr.len > global.tune.bufsize) { ...
CWE-119
null
null
6,206
static int h2s_send_rst_stream(struct h2c *h2c, struct h2s *h2s) { struct buffer *res; char str[13]; int ret; if (!h2s || h2s->st == H2_SS_CLOSED) return 1; /* RFC7540#5.4.2: To avoid looping, an endpoint MUST NOT send a * RST_STREAM in response to a RST_STREAM frame. */ if (h2c->dft == H2_FT_RST_STREAM) ...
Exec Code Overflow
0
static int h2s_send_rst_stream(struct h2c *h2c, struct h2s *h2s) { struct buffer *res; char str[13]; int ret; if (!h2s || h2s->st == H2_SS_CLOSED) return 1; /* RFC7540#5.4.2: To avoid looping, an endpoint MUST NOT send a * RST_STREAM in response to a RST_STREAM frame. */ if (h2c->dft == H2_FT_RST_STREAM) ...
@@ -1735,7 +1735,7 @@ static void h2_process_demux(struct h2c *h2c) goto fail; } - if ((int)hdr.len < 0 || (int)hdr.len > h2c->mfs) { + if ((int)hdr.len < 0 || (int)hdr.len > global.tune.bufsize) { ...
CWE-119
null
null
6,207
Current_Ratio( EXEC_OP ) { if ( !CUR.tt_metrics.ratio ) { #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING if ( CUR.face->unpatented_hinting ) { if ( CUR.GS.both_x_axis ) CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio; else CUR.tt_metrics.ratio = CUR.tt_metrics.y_rat...
DoS Exec Code Overflow
0
Current_Ratio( EXEC_OP ) { if ( !CUR.tt_metrics.ratio ) { #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING if ( CUR.face->unpatented_hinting ) { if ( CUR.GS.both_x_axis ) CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio; else CUR.tt_metrics.ratio = CUR.tt_metrics.y_rat...
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,208
Init_Context( TT_ExecContext exec, FT_Memory memory ) { FT_Error error; FT_TRACE1(( "Init_Context: new object at 0x%08p\n", exec )); exec->memory = memory; exec->callSize = 32; if ( FT_NEW_ARRAY( exec->callStack, exec->callSize ) ) goto Fail_Memory; /* al...
DoS Exec Code Overflow
0
Init_Context( TT_ExecContext exec, FT_Memory memory ) { FT_Error error; FT_TRACE1(( "Init_Context: new object at 0x%08p\n", exec )); exec->memory = memory; exec->callSize = 32; if ( FT_NEW_ARRAY( exec->callStack, exec->callSize ) ) goto Fail_Memory; /* al...
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,209
TT_Clear_CodeRange( TT_ExecContext exec, FT_Int range ) { FT_ASSERT( range >= 1 && range <= 3 ); exec->codeRangeTable[range - 1].base = NULL; exec->codeRangeTable[range - 1].size = 0; return TT_Err_Ok; }
DoS Exec Code Overflow
0
TT_Clear_CodeRange( TT_ExecContext exec, FT_Int range ) { FT_ASSERT( range >= 1 && range <= 3 ); exec->codeRangeTable[range - 1].base = NULL; exec->codeRangeTable[range - 1].size = 0; return TT_Err_Ok; }
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,210
TT_Done_Context( TT_ExecContext exec ) { FT_Memory memory = exec->memory; /* points zone */ exec->maxPoints = 0; exec->maxContours = 0; /* free stack */ FT_FREE( exec->stack ); exec->stackSize = 0; /* free call stack */ FT_FREE( exec->callStack ); exec->callSize = 0; ...
DoS Exec Code Overflow
0
TT_Done_Context( TT_ExecContext exec ) { FT_Memory memory = exec->memory; /* points zone */ exec->maxPoints = 0; exec->maxContours = 0; /* free stack */ FT_FREE( exec->stack ); exec->stackSize = 0; /* free call stack */ FT_FREE( exec->callStack ); exec->callSize = 0; ...
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,211
TT_Goto_CodeRange( TT_ExecContext exec, FT_Int range, FT_Long IP ) { TT_CodeRange* coderange; FT_ASSERT( range >= 1 && range <= 3 ); coderange = &exec->codeRangeTable[range - 1]; FT_ASSERT( coderange->base != NULL ); /* NOTE: Beca...
DoS Exec Code Overflow
0
TT_Goto_CodeRange( TT_ExecContext exec, FT_Int range, FT_Long IP ) { TT_CodeRange* coderange; FT_ASSERT( range >= 1 && range <= 3 ); coderange = &exec->codeRangeTable[range - 1]; FT_ASSERT( coderange->base != NULL ); /* NOTE: Beca...
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,212
TT_Load_Context( TT_ExecContext exec, TT_Face face, TT_Size size ) { FT_Int i; FT_ULong tmp; TT_MaxProfile* maxp; FT_Error error; exec->face = face; maxp = &face->max_profile; exec->size = size; i...
DoS Exec Code Overflow
0
TT_Load_Context( TT_ExecContext exec, TT_Face face, TT_Size size ) { FT_Int i; FT_ULong tmp; TT_MaxProfile* maxp; FT_Error error; exec->face = face; maxp = &face->max_profile; exec->size = size; i...
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,213
TT_MulFix14( FT_Int32 a, FT_Int b ) { FT_Int32 sign; FT_UInt32 ah, al, mid, lo, hi; sign = a ^ b; if ( a < 0 ) a = -a; if ( b < 0 ) b = -b; ah = (FT_UInt32)( ( a >> 16 ) & 0xFFFFU ); al = (FT_UInt32)( a & 0xFFFFU ); lo = al * b; mid = a...
DoS Exec Code Overflow
0
TT_MulFix14( FT_Int32 a, FT_Int b ) { FT_Int32 sign; FT_UInt32 ah, al, mid, lo, hi; sign = a ^ b; if ( a < 0 ) a = -a; if ( b < 0 ) b = -b; ah = (FT_UInt32)( ( a >> 16 ) & 0xFFFFU ); al = (FT_UInt32)( a & 0xFFFFU ); lo = al * b; mid = a...
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,214
TT_MulFix14( FT_Int32 a, FT_Int b ) { FT_Int32 m, s, hi; FT_UInt32 l, lo; /* compute ax*bx as 64-bit value */ l = (FT_UInt32)( ( a & 0xFFFFU ) * b ); m = ( a >> 16 ) * b; lo = l + (FT_UInt32)( m << 16 ); hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l ); ...
DoS Exec Code Overflow
0
TT_MulFix14( FT_Int32 a, FT_Int b ) { FT_Int32 m, s, hi; FT_UInt32 l, lo; /* compute ax*bx as 64-bit value */ l = (FT_UInt32)( ( a & 0xFFFFU ) * b ); m = ( a >> 16 ) * b; lo = l + (FT_UInt32)( m << 16 ); hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l ); ...
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,215
TT_New_Context( TT_Driver driver ) { TT_ExecContext exec; FT_Memory memory; memory = driver->root.root.memory; exec = driver->context; if ( !driver->context ) { FT_Error error; /* allocate object */ if ( FT_NEW( exec ) ) goto Fail; /* initiali...
DoS Exec Code Overflow
0
TT_New_Context( TT_Driver driver ) { TT_ExecContext exec; FT_Memory memory; memory = driver->root.root.memory; exec = driver->context; if ( !driver->context ) { FT_Error error; /* allocate object */ if ( FT_NEW( exec ) ) goto Fail; /* initiali...
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,216
TT_Run_Context( TT_ExecContext exec, FT_Bool debug ) { FT_Error error; if ( ( error = TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 ) ) != TT_Err_Ok ) return error; exec->zp0 = exec->pts; exec->zp1 = exec->pts; exec->zp2 = exec->pts; exec->G...
DoS Exec Code Overflow
0
TT_Run_Context( TT_ExecContext exec, FT_Bool debug ) { FT_Error error; if ( ( error = TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 ) ) != TT_Err_Ok ) return error; exec->zp0 = exec->pts; exec->zp1 = exec->pts; exec->zp2 = exec->pts; exec->G...
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,217
TT_Save_Context( TT_ExecContext exec, TT_Size size ) { FT_Int i; /* XXXX: Will probably disappear soon with all the code range */ /* management, which is now rather obsolete. */ /* */ size-...
DoS Exec Code Overflow
0
TT_Save_Context( TT_ExecContext exec, TT_Size size ) { FT_Int i; /* XXXX: Will probably disappear soon with all the code range */ /* management, which is now rather obsolete. */ /* */ size-...
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,218
TT_Set_CodeRange( TT_ExecContext exec, FT_Int range, void* base, FT_Long length ) { FT_ASSERT( range >= 1 && range <= 3 ); exec->codeRangeTable[range - 1].base = (FT_Byte*)base; exec->codeRangeTable[range - 1].size ...
DoS Exec Code Overflow
0
TT_Set_CodeRange( TT_ExecContext exec, FT_Int range, void* base, FT_Long length ) { FT_ASSERT( range >= 1 && range <= 3 ); exec->codeRangeTable[range - 1].base = (FT_Byte*)base; exec->codeRangeTable[range - 1].size ...
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,219
TT_VecLen( FT_F26Dot6 X, FT_F26Dot6 Y ) { FT_Vector v; v.x = X; v.y = Y; return FT_Vector_Length( &v ); }
DoS Exec Code Overflow
0
TT_VecLen( FT_F26Dot6 X, FT_F26Dot6 Y ) { FT_Vector v; v.x = X; v.y = Y; return FT_Vector_Length( &v ); }
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,220
Update_Max( FT_Memory memory, FT_ULong* size, FT_Long multiplier, void* _pbuff, FT_ULong new_max ) { FT_Error error; void** pbuff = (void**)_pbuff; if ( *size < new_max ) { if ( FT_REALLOC( *pbuff, *size * multiplier, ne...
DoS Exec Code Overflow
0
Update_Max( FT_Memory memory, FT_ULong* size, FT_Long multiplier, void* _pbuff, FT_ULong new_max ) { FT_Error error; void** pbuff = (void**)_pbuff; if ( *size < new_max ) { if ( FT_REALLOC( *pbuff, *size * multiplier, ne...
@@ -5795,7 +5795,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n...
CWE-119
null
null
6,221
static void XBZRLE_cache_lock(void) { if (migrate_use_xbzrle()) qemu_mutex_lock(&XBZRLE.lock); }
Exec Code
0
static void XBZRLE_cache_lock(void) { if (migrate_use_xbzrle()) qemu_mutex_lock(&XBZRLE.lock); }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,222
static void XBZRLE_cache_unlock(void) { if (migrate_use_xbzrle()) qemu_mutex_unlock(&XBZRLE.lock); }
Exec Code
0
static void XBZRLE_cache_unlock(void) { if (migrate_use_xbzrle()) qemu_mutex_unlock(&XBZRLE.lock); }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,223
static void acct_clear(void) { memset(&acct_info, 0, sizeof(acct_info)); }
Exec Code
0
static void acct_clear(void) { memset(&acct_info, 0, sizeof(acct_info)); }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,224
void acct_update_position(QEMUFile *f, size_t size, bool zero) { uint64_t pages = size / TARGET_PAGE_SIZE; if (zero) { acct_info.dup_pages += pages; } else { acct_info.norm_pages += pages; bytes_transferred += size; qemu_update_position(f, size); } }
Exec Code
0
void acct_update_position(QEMUFile *f, size_t size, bool zero) { uint64_t pages = size / TARGET_PAGE_SIZE; if (zero) { acct_info.dup_pages += pages; } else { acct_info.norm_pages += pages; bytes_transferred += size; qemu_update_position(f, size); } }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,225
void cpudef_init(void) { #if defined(cpudef_setup) cpudef_setup(); /* parse cpu definitions in target config file */ #endif }
Exec Code
0
void cpudef_init(void) { #if defined(cpudef_setup) cpudef_setup(); /* parse cpu definitions in target config file */ #endif }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,226
void do_acpitable_option(const QemuOpts *opts) { #ifdef TARGET_I386 Error *err = NULL; acpi_table_add(opts, &err); if (err) { error_report("Wrong acpi table provided: %s", error_get_pretty(err)); error_free(err); exit(1); } #endif }
Exec Code
0
void do_acpitable_option(const QemuOpts *opts) { #ifdef TARGET_I386 Error *err = NULL; acpi_table_add(opts, &err); if (err) { error_report("Wrong acpi table provided: %s", error_get_pretty(err)); error_free(err); exit(1); } #endif }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,227
void do_smbios_option(QemuOpts *opts) { #ifdef TARGET_I386 smbios_entry_add(opts); #endif }
Exec Code
0
void do_smbios_option(QemuOpts *opts) { #ifdef TARGET_I386 smbios_entry_add(opts); #endif }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,228
uint64_t dup_mig_bytes_transferred(void) { return acct_info.dup_pages * TARGET_PAGE_SIZE; }
Exec Code
0
uint64_t dup_mig_bytes_transferred(void) { return acct_info.dup_pages * TARGET_PAGE_SIZE; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,229
uint64_t dup_mig_pages_transferred(void) { return acct_info.dup_pages; }
Exec Code
0
uint64_t dup_mig_pages_transferred(void) { return acct_info.dup_pages; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,230
void free_xbzrle_decoded_buf(void) { g_free(xbzrle_decoded_buf); xbzrle_decoded_buf = NULL; }
Exec Code
0
void free_xbzrle_decoded_buf(void) { g_free(xbzrle_decoded_buf); xbzrle_decoded_buf = NULL; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,231
static inline bool is_zero_range(uint8_t *p, uint64_t size) { return buffer_find_nonzero_offset(p, size) == size; }
Exec Code
0
static inline bool is_zero_range(uint8_t *p, uint64_t size) { return buffer_find_nonzero_offset(p, size) == size; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,232
void isa_register_soundhw(const char *name, const char *descr, int (*init_isa)(ISABus *bus)) { assert(soundhw_count < ARRAY_SIZE(soundhw) - 1); soundhw[soundhw_count].name = name; soundhw[soundhw_count].descr = descr; soundhw[soundhw_count].isa = 1; soundhw[soundhw_count].i...
Exec Code
0
void isa_register_soundhw(const char *name, const char *descr, int (*init_isa)(ISABus *bus)) { assert(soundhw_count < ARRAY_SIZE(soundhw) - 1); soundhw[soundhw_count].name = name; soundhw[soundhw_count].descr = descr; soundhw[soundhw_count].isa = 1; soundhw[soundhw_count].i...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,233
int kvm_available(void) { #ifdef CONFIG_KVM return 1; #else return 0; #endif }
Exec Code
0
int kvm_available(void) { #ifdef CONFIG_KVM return 1; #else return 0; #endif }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,234
static int load_xbzrle(QEMUFile *f, ram_addr_t addr, void *host) { unsigned int xh_len; int xh_flags; if (!xbzrle_decoded_buf) { xbzrle_decoded_buf = g_malloc(TARGET_PAGE_SIZE); } /* extract RLE header */ xh_flags = qemu_get_byte(f); xh_len = qemu_get_be16(f); if (xh_flags != ...
Exec Code
0
static int load_xbzrle(QEMUFile *f, ram_addr_t addr, void *host) { unsigned int xh_len; int xh_flags; if (!xbzrle_decoded_buf) { xbzrle_decoded_buf = g_malloc(TARGET_PAGE_SIZE); } /* extract RLE header */ xh_flags = qemu_get_byte(f); xh_len = qemu_get_be16(f); if (xh_flags != ...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,235
static void mig_throttle_guest_down(void) { CPUState *cpu; qemu_mutex_lock_iothread(); CPU_FOREACH(cpu) { async_run_on_cpu(cpu, mig_sleep_cpu, NULL); } qemu_mutex_unlock_iothread(); }
Exec Code
0
static void mig_throttle_guest_down(void) { CPUState *cpu; qemu_mutex_lock_iothread(); CPU_FOREACH(cpu) { async_run_on_cpu(cpu, mig_sleep_cpu, NULL); } qemu_mutex_unlock_iothread(); }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,236
ram_addr_t migration_bitmap_find_and_reset_dirty(MemoryRegion *mr, ram_addr_t start) { unsigned long base = mr->ram_addr >> TARGET_PAGE_BITS; unsigned long nr = base + (start >> TARGET_PAGE_BITS); uint64_t mr_size = TARGET_PAGE_ALIGN(memory_region_size(mr)); ...
Exec Code
0
ram_addr_t migration_bitmap_find_and_reset_dirty(MemoryRegion *mr, ram_addr_t start) { unsigned long base = mr->ram_addr >> TARGET_PAGE_BITS; unsigned long nr = base + (start >> TARGET_PAGE_BITS); uint64_t mr_size = TARGET_PAGE_ALIGN(memory_region_size(mr)); ...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,237
static inline bool migration_bitmap_set_dirty(ram_addr_t addr) { bool ret; int nr = addr >> TARGET_PAGE_BITS; ret = test_and_set_bit(nr, migration_bitmap); if (!ret) { migration_dirty_pages++; } return ret; }
Exec Code
0
static inline bool migration_bitmap_set_dirty(ram_addr_t addr) { bool ret; int nr = addr >> TARGET_PAGE_BITS; ret = test_and_set_bit(nr, migration_bitmap); if (!ret) { migration_dirty_pages++; } return ret; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,238
static void migration_bitmap_sync(void) { RAMBlock *block; uint64_t num_dirty_pages_init = migration_dirty_pages; MigrationState *s = migrate_get_current(); static int64_t start_time; static int64_t bytes_xfer_prev; static int64_t num_dirty_pages_period; int64_t end_time; int64_t bytes_x...
Exec Code
0
static void migration_bitmap_sync(void) { RAMBlock *block; uint64_t num_dirty_pages_init = migration_dirty_pages; MigrationState *s = migrate_get_current(); static int64_t start_time; static int64_t bytes_xfer_prev; static int64_t num_dirty_pages_period; int64_t end_time; int64_t bytes_x...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,239
static void migration_bitmap_sync_range(ram_addr_t start, ram_addr_t length) { ram_addr_t addr; unsigned long page = BIT_WORD(start >> TARGET_PAGE_BITS); /* start address is aligned at the start of a word? */ if (((page * BITS_PER_LONG) << TARGET_PAGE_BITS) == start) { int k; int nr = B...
Exec Code
0
static void migration_bitmap_sync_range(ram_addr_t start, ram_addr_t length) { ram_addr_t addr; unsigned long page = BIT_WORD(start >> TARGET_PAGE_BITS); /* start address is aligned at the start of a word? */ if (((page * BITS_PER_LONG) << TARGET_PAGE_BITS) == start) { int k; int nr = B...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,240
static void migration_end(void) { if (migration_bitmap) { memory_global_dirty_log_stop(); g_free(migration_bitmap); migration_bitmap = NULL; } XBZRLE_cache_lock(); if (XBZRLE.cache) { cache_fini(XBZRLE.cache); g_free(XBZRLE.encoded_buf); g_free(XBZRLE.cur...
Exec Code
0
static void migration_end(void) { if (migration_bitmap) { memory_global_dirty_log_stop(); g_free(migration_bitmap); migration_bitmap = NULL; } XBZRLE_cache_lock(); if (XBZRLE.cache) { cache_fini(XBZRLE.cache); g_free(XBZRLE.encoded_buf); g_free(XBZRLE.cur...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,241
uint64_t norm_mig_bytes_transferred(void) { return acct_info.norm_pages * TARGET_PAGE_SIZE; }
Exec Code
0
uint64_t norm_mig_bytes_transferred(void) { return acct_info.norm_pages * TARGET_PAGE_SIZE; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,242
uint64_t norm_mig_pages_transferred(void) { return acct_info.norm_pages; }
Exec Code
0
uint64_t norm_mig_pages_transferred(void) { return acct_info.norm_pages; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,243
int qemu_read_default_config_files(bool userconfig) { int ret; struct defconfig_file *f; for (f = default_config_files; f->filename; f++) { if (!userconfig && f->userconfig) { continue; } ret = qemu_read_config_file(f->filename); if (ret < 0 && ret != -ENOENT) { ...
Exec Code
0
int qemu_read_default_config_files(bool userconfig) { int ret; struct defconfig_file *f; for (f = default_config_files; f->filename; f++) { if (!userconfig && f->userconfig) { continue; } ret = qemu_read_config_file(f->filename); if (ret < 0 && ret != -ENOENT) { ...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,244
int qemu_uuid_parse(const char *str, uint8_t *uuid) { int ret; if (strlen(str) != 36) { return -1; } ret = sscanf(str, UUID_FMT, &uuid[0], &uuid[1], &uuid[2], &uuid[3], &uuid[4], &uuid[5], &uuid[6], &uuid[7], &uuid[8], &uuid[9], &uuid[10], &uuid[11], &uuid[12]...
Exec Code
0
int qemu_uuid_parse(const char *str, uint8_t *uuid) { int ret; if (strlen(str) != 36) { return -1; } ret = sscanf(str, UUID_FMT, &uuid[0], &uuid[1], &uuid[2], &uuid[3], &uuid[4], &uuid[5], &uuid[6], &uuid[7], &uuid[8], &uuid[9], &uuid[10], &uuid[11], &uuid[12]...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,245
TargetInfo *qmp_query_target(Error **errp) { TargetInfo *info = g_malloc0(sizeof(*info)); info->arch = g_strdup(TARGET_NAME); return info; }
Exec Code
0
TargetInfo *qmp_query_target(Error **errp) { TargetInfo *info = g_malloc0(sizeof(*info)); info->arch = g_strdup(TARGET_NAME); return info; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,246
uint64_t ram_bytes_remaining(void) { return ram_save_remaining() * TARGET_PAGE_SIZE; }
Exec Code
0
uint64_t ram_bytes_remaining(void) { return ram_save_remaining() * TARGET_PAGE_SIZE; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,247
uint64_t ram_bytes_total(void) { RAMBlock *block; uint64_t total = 0; QTAILQ_FOREACH(block, &ram_list.blocks, next) total += block->length; return total; }
Exec Code
0
uint64_t ram_bytes_total(void) { RAMBlock *block; uint64_t total = 0; QTAILQ_FOREACH(block, &ram_list.blocks, next) total += block->length; return total; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,248
uint64_t ram_bytes_transferred(void) { return bytes_transferred; }
Exec Code
0
uint64_t ram_bytes_transferred(void) { return bytes_transferred; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,249
static int ram_find_and_save_block(QEMUFile *f, bool last_stage) { RAMBlock *block = last_seen_block; ram_addr_t offset = last_offset; bool complete_round = false; int bytes_sent = 0; MemoryRegion *mr; if (!block) block = QTAILQ_FIRST(&ram_list.blocks); while (true) { mr = ...
Exec Code
0
static int ram_find_and_save_block(QEMUFile *f, bool last_stage) { RAMBlock *block = last_seen_block; ram_addr_t offset = last_offset; bool complete_round = false; int bytes_sent = 0; MemoryRegion *mr; if (!block) block = QTAILQ_FIRST(&ram_list.blocks); while (true) { mr = ...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,250
void ram_handle_compressed(void *host, uint8_t ch, uint64_t size) { if (ch != 0 || !is_zero_range(host, size)) { memset(host, ch, size); } }
Exec Code
0
void ram_handle_compressed(void *host, uint8_t ch, uint64_t size) { if (ch != 0 || !is_zero_range(host, size)) { memset(host, ch, size); } }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,251
static int ram_load(QEMUFile *f, void *opaque, int version_id) { int flags = 0, ret = 0; static uint64_t seq_iter; seq_iter++; if (version_id != 4) { ret = -EINVAL; } while (!ret && !(flags & RAM_SAVE_FLAG_EOS)) { ram_addr_t addr, total_ram_bytes; void *host; u...
Exec Code
0
static int ram_load(QEMUFile *f, void *opaque, int version_id) { int flags = 0, ret = 0; static uint64_t seq_iter; seq_iter++; if (version_id != 4) { ret = -EINVAL; } while (!ret && !(flags & RAM_SAVE_FLAG_EOS)) { ram_addr_t addr, total_ram_bytes; void *host; u...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,252
void ram_mig_init(void) { qemu_mutex_init(&XBZRLE.lock); register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, NULL); }
Exec Code
0
void ram_mig_init(void) { qemu_mutex_init(&XBZRLE.lock); register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, NULL); }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,253
static int ram_save_iterate(QEMUFile *f, void *opaque) { int ret; int i; int64_t t0; int total_sent = 0; qemu_mutex_lock_ramlist(); if (ram_list.version != last_version) { reset_ram_globals(); } ram_control_before_iterate(f, RAM_CONTROL_ROUND); t0 = qemu_clock_get_ns(QEMU...
Exec Code
0
static int ram_save_iterate(QEMUFile *f, void *opaque) { int ret; int i; int64_t t0; int total_sent = 0; qemu_mutex_lock_ramlist(); if (ram_list.version != last_version) { reset_ram_globals(); } ram_control_before_iterate(f, RAM_CONTROL_ROUND); t0 = qemu_clock_get_ns(QEMU...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,254
static int ram_save_page(QEMUFile *f, RAMBlock* block, ram_addr_t offset, bool last_stage) { int bytes_sent; int cont; ram_addr_t current_addr; MemoryRegion *mr = block->mr; uint8_t *p; int ret; bool send_async = true; cont = (block == last_sent_block) ? RAM_SAV...
Exec Code
0
static int ram_save_page(QEMUFile *f, RAMBlock* block, ram_addr_t offset, bool last_stage) { int bytes_sent; int cont; ram_addr_t current_addr; MemoryRegion *mr = block->mr; uint8_t *p; int ret; bool send_async = true; cont = (block == last_sent_block) ? RAM_SAV...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,255
static uint64_t ram_save_pending(QEMUFile *f, void *opaque, uint64_t max_size) { uint64_t remaining_size; remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE; if (remaining_size < max_size) { qemu_mutex_lock_iothread(); migration_bitmap_sync(); qemu_mutex_unlock_iothread(); ...
Exec Code
0
static uint64_t ram_save_pending(QEMUFile *f, void *opaque, uint64_t max_size) { uint64_t remaining_size; remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE; if (remaining_size < max_size) { qemu_mutex_lock_iothread(); migration_bitmap_sync(); qemu_mutex_unlock_iothread(); ...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,256
static ram_addr_t ram_save_remaining(void) { return migration_dirty_pages; }
Exec Code
0
static ram_addr_t ram_save_remaining(void) { return migration_dirty_pages; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,257
static int ram_save_setup(QEMUFile *f, void *opaque) { RAMBlock *block; int64_t ram_bitmap_pages; /* Size of bitmap in pages, including gaps */ mig_throttle_on = false; dirty_rate_high_cnt = 0; bitmap_sync_count = 0; if (migrate_use_xbzrle()) { XBZRLE_cache_lock(); XBZRLE.cache...
Exec Code
0
static int ram_save_setup(QEMUFile *f, void *opaque) { RAMBlock *block; int64_t ram_bitmap_pages; /* Size of bitmap in pages, including gaps */ mig_throttle_on = false; dirty_rate_high_cnt = 0; bitmap_sync_count = 0; if (migrate_use_xbzrle()) { XBZRLE_cache_lock(); XBZRLE.cache...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,258
static void reset_ram_globals(void) { last_seen_block = NULL; last_sent_block = NULL; last_offset = 0; last_version = ram_list.version; ram_bulk_stage = true; }
Exec Code
0
static void reset_ram_globals(void) { last_seen_block = NULL; last_sent_block = NULL; last_offset = 0; last_version = ram_list.version; ram_bulk_stage = true; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,259
static int save_xbzrle_page(QEMUFile *f, uint8_t **current_data, ram_addr_t current_addr, RAMBlock *block, ram_addr_t offset, int cont, bool last_stage) { int encoded_len = 0, bytes_sent = -1; uint8_t *prev_cached_page; if (!cache_is_cached(XBZRLE.cac...
Exec Code
0
static int save_xbzrle_page(QEMUFile *f, uint8_t **current_data, ram_addr_t current_addr, RAMBlock *block, ram_addr_t offset, int cont, bool last_stage) { int encoded_len = 0, bytes_sent = -1; uint8_t *prev_cached_page; if (!cache_is_cached(XBZRLE.cac...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,260
void select_soundhw(const char *optarg) { struct soundhw *c; if (is_help_option(optarg)) { show_valid_cards: if (soundhw_count) { printf("Valid sound card names (comma separated):\n"); for (c = soundhw; c->name; ++c) { printf ("%-11s %s\n", c->name, c->de...
Exec Code
0
void select_soundhw(const char *optarg) { struct soundhw *c; if (is_help_option(optarg)) { show_valid_cards: if (soundhw_count) { printf("Valid sound card names (comma separated):\n"); for (c = soundhw; c->name; ++c) { printf ("%-11s %s\n", c->name, c->de...
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,261
uint64_t skipped_mig_bytes_transferred(void) { return acct_info.skipped_pages * TARGET_PAGE_SIZE; }
Exec Code
0
uint64_t skipped_mig_bytes_transferred(void) { return acct_info.skipped_pages * TARGET_PAGE_SIZE; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,262
uint64_t skipped_mig_pages_transferred(void) { return acct_info.skipped_pages; }
Exec Code
0
uint64_t skipped_mig_pages_transferred(void) { return acct_info.skipped_pages; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,263
uint64_t xbzrle_mig_bytes_transferred(void) { return acct_info.xbzrle_bytes; }
Exec Code
0
uint64_t xbzrle_mig_bytes_transferred(void) { return acct_info.xbzrle_bytes; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,264
double xbzrle_mig_cache_miss_rate(void) { return acct_info.xbzrle_cache_miss_rate; }
Exec Code
0
double xbzrle_mig_cache_miss_rate(void) { return acct_info.xbzrle_cache_miss_rate; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,265
uint64_t xbzrle_mig_pages_cache_miss(void) { return acct_info.xbzrle_cache_miss; }
Exec Code
0
uint64_t xbzrle_mig_pages_cache_miss(void) { return acct_info.xbzrle_cache_miss; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,266
uint64_t xbzrle_mig_pages_overflow(void) { return acct_info.xbzrle_overflows; }
Exec Code
0
uint64_t xbzrle_mig_pages_overflow(void) { return acct_info.xbzrle_overflows; }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,267
int xen_available(void) { #ifdef CONFIG_XEN return 1; #else return 0; #endif }
Exec Code
0
int xen_available(void) { #ifdef CONFIG_XEN return 1; #else return 0; #endif }
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f, uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { - if (!block) { + if (!block || block->length <= offset) { error_report("Ack, bad migration stream!"); return NULL; } @@ -1019,8 ...
CWE-20
null
null
6,268
static int addfunction(JF, js_Function *value) { if (F->funlen >= F->funcap) { F->funcap = F->funcap ? F->funcap * 2 : 16; F->funtab = js_realloc(J, F->funtab, F->funcap * sizeof *F->funtab); } F->funtab[F->funlen] = value; return F->funlen++; }
DoS
0
static int addfunction(JF, js_Function *value) { if (F->funlen >= F->funcap) { F->funcap = F->funcap ? F->funcap * 2 : 16; F->funtab = js_realloc(J, F->funtab, F->funcap * sizeof *F->funtab); } F->funtab[F->funlen] = value; return F->funlen++; }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,269
static void addjump(JF, enum js_AstType type, js_Ast *target, int inst) { js_JumpList *jump = js_malloc(J, sizeof *jump); jump->type = type; jump->inst = inst; jump->next = target->jumps; target->jumps = jump; }
DoS
0
static void addjump(JF, enum js_AstType type, js_Ast *target, int inst) { js_JumpList *jump = js_malloc(J, sizeof *jump); jump->type = type; jump->inst = inst; jump->next = target->jumps; target->jumps = jump; }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,270
static void addlocal(JF, js_Ast *ident, int reuse) { const char *name = ident->string; if (J->strict) { if (!strcmp(name, "arguments")) jsC_error(J, ident, "redefining 'arguments' is not allowed in strict mode"); if (!strcmp(name, "eval")) jsC_error(J, ident, "redefining 'eval' is not allowed in strict mode...
DoS
0
static void addlocal(JF, js_Ast *ident, int reuse) { const char *name = ident->string; if (J->strict) { if (!strcmp(name, "arguments")) jsC_error(J, ident, "redefining 'arguments' is not allowed in strict mode"); if (!strcmp(name, "eval")) jsC_error(J, ident, "redefining 'eval' is not allowed in strict mode...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,271
static int addnumber(JF, double value) { int i; for (i = 0; i < F->numlen; ++i) if (F->numtab[i] == value) return i; if (F->numlen >= F->numcap) { F->numcap = F->numcap ? F->numcap * 2 : 16; F->numtab = js_realloc(J, F->numtab, F->numcap * sizeof *F->numtab); } F->numtab[F->numlen] = value; return F->num...
DoS
0
static int addnumber(JF, double value) { int i; for (i = 0; i < F->numlen; ++i) if (F->numtab[i] == value) return i; if (F->numlen >= F->numcap) { F->numcap = F->numcap ? F->numcap * 2 : 16; F->numtab = js_realloc(J, F->numtab, F->numcap * sizeof *F->numtab); } F->numtab[F->numlen] = value; return F->num...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,272
static int addstring(JF, const char *value) { int i; for (i = 0; i < F->strlen; ++i) if (!strcmp(F->strtab[i], value)) return i; if (F->strlen >= F->strcap) { F->strcap = F->strcap ? F->strcap * 2 : 16; F->strtab = js_realloc(J, F->strtab, F->strcap * sizeof *F->strtab); } F->strtab[F->strlen] = value; r...
DoS
0
static int addstring(JF, const char *value) { int i; for (i = 0; i < F->strlen; ++i) if (!strcmp(F->strtab[i], value)) return i; if (F->strlen >= F->strcap) { F->strcap = F->strcap ? F->strcap * 2 : 16; F->strtab = js_realloc(J, F->strtab, F->strcap * sizeof *F->strtab); } F->strtab[F->strlen] = value; r...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,273
static void analyze(JF, js_Ast *node) { if (isfun(node->type)) { F->lightweight = 0; return; /* don't scan inner functions */ } if (node->type == STM_WITH) { F->lightweight = 0; } if (node->type == STM_TRY && node->c) { F->lightweight = 0; } if (node->type == EXP_IDENTIFIER) { if (!strcmp(node->stri...
DoS
0
static void analyze(JF, js_Ast *node) { if (isfun(node->type)) { F->lightweight = 0; return; /* don't scan inner functions */ } if (node->type == STM_WITH) { F->lightweight = 0; } if (node->type == STM_TRY && node->c) { F->lightweight = 0; } if (node->type == EXP_IDENTIFIER) { if (!strcmp(node->stri...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,274
static js_Ast *breaktarget(JF, js_Ast *node, const char *label) { while (node) { if (isfun(node->type)) break; if (!label) { if (isloop(node->type) || node->type == STM_SWITCH) return node; } else { if (matchlabel(node->parent, label)) return node; } node = node->parent; } return NULL; }
DoS
0
static js_Ast *breaktarget(JF, js_Ast *node, const char *label) { while (node) { if (isfun(node->type)) break; if (!label) { if (isloop(node->type) || node->type == STM_SWITCH) return node; } else { if (matchlabel(node->parent, label)) return node; } node = node->parent; } return NULL; }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,275
static void cassign(JF, js_Ast *exp) { js_Ast *lhs = exp->a; js_Ast *rhs = exp->b; switch (lhs->type) { case EXP_IDENTIFIER: cexp(J, F, rhs); emitlocal(J, F, OP_SETLOCAL, OP_SETVAR, lhs); break; case EXP_INDEX: cexp(J, F, lhs->a); cexp(J, F, lhs->b); cexp(J, F, rhs); emit(J, F, OP_SETPROP); break; ...
DoS
0
static void cassign(JF, js_Ast *exp) { js_Ast *lhs = exp->a; js_Ast *rhs = exp->b; switch (lhs->type) { case EXP_IDENTIFIER: cexp(J, F, rhs); emitlocal(J, F, OP_SETLOCAL, OP_SETVAR, lhs); break; case EXP_INDEX: cexp(J, F, lhs->a); cexp(J, F, lhs->b); cexp(J, F, rhs); emit(J, F, OP_SETPROP); break; ...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,276
static void cassignforin(JF, js_Ast *stm) { js_Ast *lhs = stm->a; if (stm->type == STM_FOR_IN_VAR) { if (lhs->b) jsC_error(J, lhs->b, "more than one loop variable in for-in statement"); emitlocal(J, F, OP_SETLOCAL, OP_SETVAR, lhs->a->a); /* list(var-init(ident)) */ emit(J, F, OP_POP); return; } switch ...
DoS
0
static void cassignforin(JF, js_Ast *stm) { js_Ast *lhs = stm->a; if (stm->type == STM_FOR_IN_VAR) { if (lhs->b) jsC_error(J, lhs->b, "more than one loop variable in for-in statement"); emitlocal(J, F, OP_SETLOCAL, OP_SETVAR, lhs->a->a); /* list(var-init(ident)) */ emit(J, F, OP_POP); return; } switch ...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,277
static void cassignop(JF, js_Ast *exp, int opcode) { js_Ast *lhs = exp->a; js_Ast *rhs = exp->b; cassignop1(J, F, lhs); cexp(J, F, rhs); emit(J, F, opcode); cassignop2(J, F, lhs, 0); }
DoS
0
static void cassignop(JF, js_Ast *exp, int opcode) { js_Ast *lhs = exp->a; js_Ast *rhs = exp->b; cassignop1(J, F, lhs); cexp(J, F, rhs); emit(J, F, opcode); cassignop2(J, F, lhs, 0); }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,278
static void cassignop1(JF, js_Ast *lhs) { switch (lhs->type) { case EXP_IDENTIFIER: emitlocal(J, F, OP_GETLOCAL, OP_GETVAR, lhs); break; case EXP_INDEX: cexp(J, F, lhs->a); cexp(J, F, lhs->b); emit(J, F, OP_DUP2); emit(J, F, OP_GETPROP); break; case EXP_MEMBER: cexp(J, F, lhs->a); emit(J, F, OP_DU...
DoS
0
static void cassignop1(JF, js_Ast *lhs) { switch (lhs->type) { case EXP_IDENTIFIER: emitlocal(J, F, OP_GETLOCAL, OP_GETVAR, lhs); break; case EXP_INDEX: cexp(J, F, lhs->a); cexp(J, F, lhs->b); emit(J, F, OP_DUP2); emit(J, F, OP_GETPROP); break; case EXP_MEMBER: cexp(J, F, lhs->a); emit(J, F, OP_DU...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,279
static void cassignop2(JF, js_Ast *lhs, int postfix) { switch (lhs->type) { case EXP_IDENTIFIER: if (postfix) emit(J, F, OP_ROT2); emitlocal(J, F, OP_SETLOCAL, OP_SETVAR, lhs); break; case EXP_INDEX: if (postfix) emit(J, F, OP_ROT4); emit(J, F, OP_SETPROP); break; case EXP_MEMBER: if (postfix) emit(J,...
DoS
0
static void cassignop2(JF, js_Ast *lhs, int postfix) { switch (lhs->type) { case EXP_IDENTIFIER: if (postfix) emit(J, F, OP_ROT2); emitlocal(J, F, OP_SETLOCAL, OP_SETVAR, lhs); break; case EXP_INDEX: if (postfix) emit(J, F, OP_ROT4); emit(J, F, OP_SETPROP); break; case EXP_MEMBER: if (postfix) emit(J,...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,280
static void cdelete(JF, js_Ast *exp) { switch (exp->type) { case EXP_IDENTIFIER: if (J->strict) jsC_error(J, exp, "delete on an unqualified name is not allowed in strict mode"); emitlocal(J, F, OP_DELLOCAL, OP_DELVAR, exp); break; case EXP_INDEX: cexp(J, F, exp->a); cexp(J, F, exp->b); emit(J, F, OP_D...
DoS
0
static void cdelete(JF, js_Ast *exp) { switch (exp->type) { case EXP_IDENTIFIER: if (J->strict) jsC_error(J, exp, "delete on an unqualified name is not allowed in strict mode"); emitlocal(J, F, OP_DELLOCAL, OP_DELVAR, exp); break; case EXP_INDEX: cexp(J, F, exp->a); cexp(J, F, exp->b); emit(J, F, OP_D...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,281
static void cexit(JF, enum js_AstType T, js_Ast *node, js_Ast *target) { js_Ast *prev; do { prev = node, node = node->parent; switch (node->type) { default: /* impossible */ break; case STM_WITH: emit(J, F, OP_ENDWITH); break; case STM_FOR_IN: case STM_FOR_IN_VAR: /* pop the iterator if leaving t...
DoS
0
static void cexit(JF, enum js_AstType T, js_Ast *node, js_Ast *target) { js_Ast *prev; do { prev = node, node = node->parent; switch (node->type) { default: /* impossible */ break; case STM_WITH: emit(J, F, OP_ENDWITH); break; case STM_FOR_IN: case STM_FOR_IN_VAR: /* pop the iterator if leaving t...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,282
static void cfunbody(JF, js_Ast *name, js_Ast *params, js_Ast *body) { F->lightweight = 1; F->arguments = 0; if (F->script) F->lightweight = 0; if (body) analyze(J, F, body); cparams(J, F, params); if (name) { emit(J, F, OP_CURRENT); if (F->lightweight) { addlocal(J, F, name, 0); emit(J, F, OP_I...
DoS
0
static void cfunbody(JF, js_Ast *name, js_Ast *params, js_Ast *body) { F->lightweight = 1; F->arguments = 0; if (F->script) F->lightweight = 0; if (body) analyze(J, F, body); cparams(J, F, params); if (name) { emit(J, F, OP_CURRENT); if (F->lightweight) { addlocal(J, F, name, 0); emit(J, F, OP_I...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,283
static void cfundecs(JF, js_Ast *list) { while (list) { js_Ast *stm = list->a; if (stm->type == AST_FUNDEC) { emitfunction(J, F, newfun(J, stm->a, stm->b, stm->c, 0)); emitstring(J, F, OP_INITVAR, stm->a->string); } list = list->b; } }
DoS
0
static void cfundecs(JF, js_Ast *list) { while (list) { js_Ast *stm = list->a; if (stm->type == AST_FUNDEC) { emitfunction(J, F, newfun(J, stm->a, stm->b, stm->c, 0)); emitstring(J, F, OP_INITVAR, stm->a->string); } list = list->b; } }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,284
static void checkdup(JF, js_Ast *list, js_Ast *end) { char nbuf[32], sbuf[32]; const char *needle, *straw; if (end->a->type == EXP_NUMBER) needle = jsV_numbertostring(J, nbuf, end->a->number); else needle = end->a->string; while (list->a != end) { if (list->a->type == end->type) { js_Ast *prop = list->a...
DoS
0
static void checkdup(JF, js_Ast *list, js_Ast *end) { char nbuf[32], sbuf[32]; const char *needle, *straw; if (end->a->type == EXP_NUMBER) needle = jsV_numbertostring(J, nbuf, end->a->number); else needle = end->a->string; while (list->a != end) { if (list->a->type == end->type) { js_Ast *prop = list->a...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,285
static void cobject(JF, js_Ast *list) { js_Ast *head = list; while (list) { js_Ast *kv = list->a; js_Ast *prop = kv->a; if (prop->type == AST_IDENTIFIER || prop->type == EXP_STRING) emitstring(J, F, OP_STRING, prop->string); else if (prop->type == EXP_NUMBER) emitnumber(J, F, prop->number); else ...
DoS
0
static void cobject(JF, js_Ast *list) { js_Ast *head = list; while (list) { js_Ast *kv = list->a; js_Ast *prop = kv->a; if (prop->type == AST_IDENTIFIER || prop->type == EXP_STRING) emitstring(J, F, OP_STRING, prop->string); else if (prop->type == EXP_NUMBER) emitnumber(J, F, prop->number); else ...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,286
static js_Ast *continuetarget(JF, js_Ast *node, const char *label) { while (node) { if (isfun(node->type)) break; if (isloop(node->type)) { if (!label) return node; else if (matchlabel(node->parent, label)) return node; } node = node->parent; } return NULL; }
DoS
0
static js_Ast *continuetarget(JF, js_Ast *node, const char *label) { while (node) { if (isfun(node->type)) break; if (isloop(node->type)) { if (!label) return node; else if (matchlabel(node->parent, label)) return node; } node = node->parent; } return NULL; }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,287
static void cstmlist(JF, js_Ast *list) { while (list) { cstm(J, F, list->a); list = list->b; } }
DoS
0
static void cstmlist(JF, js_Ast *list) { while (list) { cstm(J, F, list->a); list = list->b; } }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,288
static void cswitch(JF, js_Ast *ref, js_Ast *head) { js_Ast *node, *clause, *def = NULL; int end; cexp(J, F, ref); /* emit an if-else chain of tests for the case clause expressions */ for (node = head; node; node = node->b) { clause = node->a; if (clause->type == STM_DEFAULT) { if (def) jsC_error(J, c...
DoS
0
static void cswitch(JF, js_Ast *ref, js_Ast *head) { js_Ast *node, *clause, *def = NULL; int end; cexp(J, F, ref); /* emit an if-else chain of tests for the case clause expressions */ for (node = head; node; node = node->b) { clause = node->a; if (clause->type == STM_DEFAULT) { if (def) jsC_error(J, c...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,289
static void ctrycatch(JF, js_Ast *trystm, js_Ast *catchvar, js_Ast *catchstm) { int L1, L2; L1 = emitjump(J, F, OP_TRY); { /* if we get here, we have caught an exception in the try block */ if (J->strict) { if (!strcmp(catchvar->string, "arguments")) jsC_error(J, catchvar, "redefining 'arguments' is not a...
DoS
0
static void ctrycatch(JF, js_Ast *trystm, js_Ast *catchvar, js_Ast *catchstm) { int L1, L2; L1 = emitjump(J, F, OP_TRY); { /* if we get here, we have caught an exception in the try block */ if (J->strict) { if (!strcmp(catchvar->string, "arguments")) jsC_error(J, catchvar, "redefining 'arguments' is not a...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,290
static void ctrycatchfinally(JF, js_Ast *trystm, js_Ast *catchvar, js_Ast *catchstm, js_Ast *finallystm) { int L1, L2, L3; L1 = emitjump(J, F, OP_TRY); { /* if we get here, we have caught an exception in the try block */ L2 = emitjump(J, F, OP_TRY); { /* if we get here, we have caught an exception in the ca...
DoS
0
static void ctrycatchfinally(JF, js_Ast *trystm, js_Ast *catchvar, js_Ast *catchstm, js_Ast *finallystm) { int L1, L2, L3; L1 = emitjump(J, F, OP_TRY); { /* if we get here, we have caught an exception in the try block */ L2 = emitjump(J, F, OP_TRY); { /* if we get here, we have caught an exception in the ca...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,291
static void ctryfinally(JF, js_Ast *trystm, js_Ast *finallystm) { int L1; L1 = emitjump(J, F, OP_TRY); { /* if we get here, we have caught an exception in the try block */ cstm(J, F, finallystm); /* inline finally block */ emit(J, F, OP_THROW); /* rethrow exception */ } label(J, F, L1); cstm(J, F, trystm); ...
DoS
0
static void ctryfinally(JF, js_Ast *trystm, js_Ast *finallystm) { int L1; L1 = emitjump(J, F, OP_TRY); { /* if we get here, we have caught an exception in the try block */ cstm(J, F, finallystm); /* inline finally block */ emit(J, F, OP_THROW); /* rethrow exception */ } label(J, F, L1); cstm(J, F, trystm); ...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,292
static void ctypeof(JF, js_Ast *exp) { if (exp->type == EXP_IDENTIFIER) emitlocal(J, F, OP_GETLOCAL, OP_HASVAR, exp); else cexp(J, F, exp); emit(J, F, OP_TYPEOF); }
DoS
0
static void ctypeof(JF, js_Ast *exp) { if (exp->type == EXP_IDENTIFIER) emitlocal(J, F, OP_GETLOCAL, OP_HASVAR, exp); else cexp(J, F, exp); emit(J, F, OP_TYPEOF); }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,293
static void cunary(JF, js_Ast *exp, int opcode) { cexp(J, F, exp->a); emit(J, F, opcode); }
DoS
0
static void cunary(JF, js_Ast *exp, int opcode) { cexp(J, F, exp->a); emit(J, F, opcode); }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,294
static void cvardecs(JF, js_Ast *node) { if (isfun(node->type)) return; /* stop at inner functions */ if (node->type == EXP_VAR) { if (F->lightweight) addlocal(J, F, node->a, 1); else emitstring(J, F, OP_DEFVAR, node->a->string); } if (node->a) cvardecs(J, F, node->a); if (node->b) cvardecs(J, F, nod...
DoS
0
static void cvardecs(JF, js_Ast *node) { if (isfun(node->type)) return; /* stop at inner functions */ if (node->type == EXP_VAR) { if (F->lightweight) addlocal(J, F, node->a, 1); else emitstring(J, F, OP_DEFVAR, node->a->string); } if (node->a) cvardecs(J, F, node->a); if (node->b) cvardecs(J, F, nod...
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,295
static void cvarinit(JF, js_Ast *list) { while (list) { js_Ast *var = list->a; if (var->b) { cexp(J, F, var->b); emitlocal(J, F, OP_SETLOCAL, OP_SETVAR, var->a); emit(J, F, OP_POP); } list = list->b; } }
DoS
0
static void cvarinit(JF, js_Ast *list) { while (list) { js_Ast *var = list->a; if (var->b) { cexp(J, F, var->b); emitlocal(J, F, OP_SETLOCAL, OP_SETVAR, var->a); emit(J, F, OP_POP); } list = list->b; } }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,296
static void emit(JF, int value) { emitraw(J, F, value); }
DoS
0
static void emit(JF, int value) { emitraw(J, F, value); }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,297
static void emitfunction(JF, js_Function *fun) { emit(J, F, OP_CLOSURE); emitraw(J, F, addfunction(J, F, fun)); }
DoS
0
static void emitfunction(JF, js_Function *fun) { emit(J, F, OP_CLOSURE); emitraw(J, F, addfunction(J, F, fun)); }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,298
static int emitjump(JF, int opcode) { int inst = F->codelen + 1; emit(J, F, opcode); emitraw(J, F, 0); return inst; }
DoS
0
static int emitjump(JF, int opcode) { int inst = F->codelen + 1; emit(J, F, opcode); emitraw(J, F, 0); return inst; }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null
6,299
static void emitjumpto(JF, int opcode, int dest) { emit(J, F, opcode); if (dest != (js_Instruction)dest) js_syntaxerror(J, "jump address integer overflow"); emitraw(J, F, dest); }
DoS
0
static void emitjumpto(JF, int opcode, int dest) { emit(J, F, opcode); if (dest != (js_Instruction)dest) js_syntaxerror(J, "jump address integer overflow"); emitraw(J, F, dest); }
@@ -1102,11 +1102,11 @@ static void cstm(JF, js_Ast *stm) case STM_BREAK: if (stm->a) { - target = breaktarget(J, F, stm, stm->a->string); + target = breaktarget(J, F, stm->parent, stm->a->string); if (!target) ...
CWE-476
null
null