mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
spa: fix potential overrun
This commit is contained in:
parent
92277ad576
commit
654adaf82a
1 changed files with 7 additions and 6 deletions
|
@ -244,12 +244,13 @@ retry_as_first:
|
|||
n = 0;
|
||||
if (!s->boundary_real_crlf)
|
||||
n = 2;
|
||||
|
||||
memcpy(s->out + s->pos, s->mime_boundary + n,
|
||||
s->mp - n);
|
||||
s->pos += s->mp;
|
||||
s->mp = 0;
|
||||
goto retry_as_first;
|
||||
if (s->mp >= n) {
|
||||
memcpy(s->out + s->pos,
|
||||
s->mime_boundary + n, s->mp - n);
|
||||
s->pos += s->mp;
|
||||
s->mp = 0;
|
||||
goto retry_as_first;
|
||||
}
|
||||
}
|
||||
|
||||
s->out[s->pos++] = *in;
|
||||
|
|
Loading…
Add table
Reference in a new issue