Commit a9e67666 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Add an assert preventing buffer overflows

Make sure that the workspace can accomodate the pipelined data before
memmoving it into place in SES_RxReInit.
parent 4529ff74
......@@ -177,6 +177,7 @@ SES_RxReInit(struct http_conn *htc)
if (htc->pipeline_b != NULL) {
l = htc->pipeline_e - htc->pipeline_b;
assert(l > 0);
assert(l <= htc->ws->r - htc->rxbuf_b);
memmove(htc->rxbuf_b, htc->pipeline_b, l);
htc->rxbuf_e += l;
htc->pipeline_b = NULL;
......
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