Skip to content
Snippets Groups Projects
Commit 59880372 authored by Dmitry Simonenko's avatar Dmitry Simonenko
Browse files

Merge branch 'client-admin-crlf-fix' into stable

parents c4648ba7 d1cbee22
No related branches found
No related tags found
No related merge requests found
......@@ -122,9 +122,16 @@ int tc_admin_reply(struct tc_admin *a, char **r, size_t *size)
memcpy(buf + off, rx, rxi);
off += rxi;
buf[off] = 0;
if (off >= 10) {
if (!memcmp(buf, "---\r\n", 5) &&
!memcmp(buf + off - 5, "...\r\n", 5)) {
if (off >= 8) {
int done_cr =
!memcmp(buf, "---\n", 4) &&
!memcmp(buf + off - 4, "...\n", 4);
int done_crlf = !done_cr &&
off >= 10 &&
!memcmp(buf, "---\r\n", 5) &&
!memcmp(buf + off - 5, "...\r\n", 5);
if (done_crlf || done_cr) {
*r = buf;
*size = off;
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment