commit 73d8b456eba75fa7c37b16b673585d992afc6df2
parent 29c8cfa2017b1d8401ca01850aa8cb6c0530834f
Author: FRIGN <dev@frign.de>
Date: Mon, 25 Aug 2014 00:33:00 +0200
always null-terminate reqbuf buffer
thanks Hiltjo for the patch
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/quark.c b/quark.c
@@ -451,8 +451,9 @@ request(void) {
&& !strstr(reqbuf, "\r\n\r\n") && !strstr(reqbuf, "\n\n"); )
{
offset += r;
- reqbuf[offset] = 0;
}
+ reqbuf[offset] = 0;
+
if (r == -1) {
logerrmsg("error\tread: %s\n", strerror(errno));
return -1;