Module: wine Branch: master Commit: 45fbfbcef43d465d9f970ee954e3ea7297df9dab URL: http://source.winehq.org/git/wine.git/?a=commit;h=45fbfbcef43d465d9f970ee954...
Author: Marcus Meissner marcus@jet.franken.de Date: Wed Jan 23 22:26:58 2008 +0100
wininet: Check if buffer has overflowed potentially.
---
dlls/wininet/tests/http.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index ec2df72..457a65f 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,