From 45fbfbcef43d465d9f970ee954e3ea7297df9dab Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 23 Jan 2008 22:26:58 +0100 Subject: [PATCH] wininet: Check if buffer has overflowed potentially. --- dlls/wininet/tests/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index ec2df72d988..457a65ffd97 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -999,7 +999,7 @@ static void HttpHeaders_test(void) ok(index == 1, "Index was not incremented\n"); ok(strcmp(buffer,"test1")==0, "incorrect string was returned(%s)\n",buffer); ok(len == 5, "Invalid length (exp. 5, got %d)\n", len); - ok(buffer[len] == 0, "Buffer not NULL-terminated\n"); /* len show only 5 characters but the buffer is NULL-terminated*/ + ok((len < sizeof(buffer)) && (buffer[len] == 0), "Buffer not NULL-terminated\n"); /* len show only 5 characters but the buffer is NULL-terminated*/ len = sizeof(buffer); strcpy(buffer,"Warning"); ok(HttpQueryInfo(hRequest,HTTP_QUERY_CUSTOM|HTTP_QUERY_FLAG_REQUEST_HEADERS, -- 2.11.4.GIT