From: Jay Satiro Date: Wed, 13 Sep 2023 17:57:39 +0000 (-0400) Subject: tool_cb_wrt: fix debug assertion X-Git-Tag: curl-8_4_0~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73980f9ace6c7577e7fcab8008bbde8a0a231692;p=thirdparty%2Fcurl.git tool_cb_wrt: fix debug assertion - Fix off-by-one out-of-bounds array index in Windows debug assertion. Bug: https://github.com/curl/curl/commit/af3f4e41#r127212213 Reported-by: Gisle Vanem --- diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c index 2f8c6ac71e..b7838664e9 100644 --- a/src/tool_cb_wrt.c +++ b/src/tool_cb_wrt.c @@ -287,7 +287,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) if(MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)outs->utf8seq, -1, prefix, sizeof(prefix)/sizeof(prefix[0]))) { - DEBUGASSERT(prefix[3] == L'\0'); + DEBUGASSERT(prefix[2] == L'\0'); if(!WriteConsoleW( (HANDLE) fhnd, prefix,