Null terminate string in buffer before feeding it to strtol()

This commit is contained in:
Yang Tse 2006-07-14 06:31:41 +00:00
parent 700cd5805c
commit ccfce89423
1 changed files with 1 additions and 0 deletions

View File

@ -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))