Skip to content
Snippets Groups Projects
Commit 654adaf8 authored by Andy Green's avatar Andy Green
Browse files

spa: fix potential overrun

parent 92277ad5
Branches
Tags
No related merge requests found
...@@ -244,12 +244,13 @@ retry_as_first: ...@@ -244,12 +244,13 @@ retry_as_first:
n = 0; n = 0;
if (!s->boundary_real_crlf) if (!s->boundary_real_crlf)
n = 2; n = 2;
if (s->mp >= n) {
memcpy(s->out + s->pos, s->mime_boundary + n, memcpy(s->out + s->pos,
s->mp - n); s->mime_boundary + n, s->mp - n);
s->pos += s->mp; s->pos += s->mp;
s->mp = 0; s->mp = 0;
goto retry_as_first; goto retry_as_first;
}
} }
s->out[s->pos++] = *in; s->out[s->pos++] = *in;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment