mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
lepc: added bound check for collect_tgt
This commit is contained in:
parent
d1d622d3b9
commit
090ec8ef6b
1 changed files with 15 additions and 4 deletions
|
@ -673,10 +673,21 @@ push_m:
|
|||
* We're collecting int / float pieces
|
||||
*/
|
||||
case LECP_COLLECT:
|
||||
if (ctx->be)
|
||||
*ctx->collect_tgt++ = c;
|
||||
else
|
||||
*ctx->collect_tgt-- = c;
|
||||
if (ctx->be) {
|
||||
|
||||
if (ctx->collect_tgt + 1 >= &ctx->item.opcode)
|
||||
*ctx->collect_tgt = c;
|
||||
else
|
||||
*ctx->collect_tgt++ = c;
|
||||
|
||||
} else {
|
||||
|
||||
if (ctx->collect_tgt <= (uint8_t *)&ctx->item.u)
|
||||
*ctx->collect_tgt = c;
|
||||
else
|
||||
*ctx->collect_tgt-- = c;
|
||||
|
||||
}
|
||||
|
||||
if (--st->collect_rem)
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue