aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2006-07-14 06:31:41 +0000
committerYang Tse <yangsita@gmail.com>2006-07-14 06:31:41 +0000
commitccfce894239f431604ff07ec47126f53ecccbdd3 (patch)
tree493ad77e4437b11234fc77bcf34bb5a8725d53e5 /tests
parent700cd5805ce8b02a63d7efaaecd06e81febf0eeb (diff)
Null terminate string in buffer before feeding it to strtol()
Diffstat (limited to 'tests')
-rw-r--r--tests/server/sockfilt.c1
1 files changed, 1 insertions, 0 deletions
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))