From: Yang Tse Date: Fri, 14 Jul 2006 06:31:41 +0000 (+0000) Subject: Null terminate string in buffer before feeding it to strtol() X-Git-Tag: curl-7_15_5~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ccfce894239f431604ff07ec47126f53ecccbdd3;p=curl Null terminate string in buffer before feeding it to strtol() --- 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))