wininet: Increase buffer in _test_status_code to avoid potential potential overflow.
gerald at pfeifer.com
Sun Oct 2 05:15:40 CDT 2016
In _test_status_code exbuf is char, but we then use this in
sprintf(exbuf, "%u", excode)
which can, in principle, print 10 digits plus the final \0, thus
I opted to make the buffer 12 chars instead of only 11, for simplicity,
to technically also be large enough for signed values, and since with
natural variable alignment this doesn't actually cost us anything.
This is another case that GCC 7 is going to warn about.
There aren't many more left in all of Wine, though, which speaks for
the quality of the codebase. ;-)
Signed-off-by: Gerald Pfeifer <gerald at pfeifer.com>
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 fc68fe1..f2fe25c 100644
@@ -200,7 +200,7 @@ static BOOL proxy_active(void)
static void _test_status_code(unsigned line, HINTERNET req, DWORD excode, BOOL is_todo)
DWORD code, size, index;
- char exbuf, bufa;
+ char exbuf, bufa;
More information about the wine-patches