From ccfce894239f431604ff07ec47126f53ecccbdd3 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 14 Jul 2006 06:31:41 +0000 Subject: Null terminate string in buffer before feeding it to strtol() --- tests/server/sockfilt.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 333e02f26..4b9fec4ef 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -290,6 +290,7 @@ static int juggle(curl_socket_t *sockfdp, if(5 != read(fileno(stdin), buffer, 5)) return FALSE; + buffer[4] = '\0'; len = (ssize_t)strtol((char *)buffer, NULL, 16); if(len != read(fileno(stdin), buffer, len)) -- cgit v1.2.3