From 7894f7c563c3009d9bc5a683e4a107c91da3db47 Mon Sep 17 00:00:00 2001 From: A13501350 <18516149786@163.com> Date: Thu, 27 Aug 2026 16:35:30 +0800 Subject: [PATCH] Fix IIS Content-Length formatting: use correct printf specifier and full buffer size --- iis/mymodule.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iis/mymodule.cpp b/iis/mymodule.cpp index dfaee4b2cb..40f54d270a 100644 --- a/iis/mymodule.cpp +++ b/iis/mymodule.cpp @@ -639,9 +639,9 @@ CMyHttpModule::OnSendResponse( ZeroMemory(szLength, sizeof(szLength)); - hr = StringCchPrintfA( + hr = StringCchPrintfA( szLength, - sizeof(szLength) / sizeof(CHAR) - 1, "%d", + sizeof(szLength) / sizeof(CHAR), "%llu", ulTotalLength); if(FAILED(hr)) @@ -1139,7 +1139,7 @@ apr_status_t WriteBodyCallback(request_rec *r, char *buf, unsigned int length) HRESULT hr = StringCchPrintfA( szLength, - sizeof(szLength) / sizeof(CHAR) - 1, "%d", + sizeof(szLength) / sizeof(CHAR), "%u", length); if(FAILED(hr)) @@ -1227,7 +1227,7 @@ apr_status_t WriteResponseCallback(request_rec *r, char *buf, unsigned int lengt HRESULT hr = StringCchPrintfA( szLength, - sizeof(szLength) / sizeof(CHAR) - 1, "%d", + sizeof(szLength) / sizeof(CHAR), "%u", length); if(FAILED(hr))