Commit fd80d9d6 authored by Dag Haavi Finstad's avatar Dag Haavi Finstad

PROXY1: Avoid AN() on malformed input.

parent 22004936
...@@ -66,7 +66,8 @@ vpx_proto1(const struct worker *wrk, struct req *req) ...@@ -66,7 +66,8 @@ vpx_proto1(const struct worker *wrk, struct req *req)
VSL(SLT_Debug, req->sp->fd, "PROXY1"); VSL(SLT_Debug, req->sp->fd, "PROXY1");
q = strchr(req->htc->rxbuf_b, '\r'); q = strchr(req->htc->rxbuf_b, '\r');
AN(q); if (!q)
return (-1);
*q++ = '\0'; *q++ = '\0';
/* Nuke the CRNL */ /* Nuke the CRNL */
......
...@@ -157,3 +157,9 @@ client c1 { ...@@ -157,3 +157,9 @@ client c1 {
} -run } -run
delay .1 delay .1
# Malformed (missing \r)
client c1 {
send "PROXY TCP4 1.2.3.4 5.6.7.8 1234 5678\n"
expect_close
} -run
delay .1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment