From: Christophe Jaillet Date: Sun, 8 Mar 2020 10:29:54 +0000 (+0000) Subject: Merge r1872394 from trunk X-Git-Tag: 2.4.42~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d36314923304c56f050709408f07609220a0a309;p=thirdparty%2Fapache%2Fhttpd.git Merge r1872394 from trunk * In winnt_accept() (server/mpm/winnt/child.c), there's a call to PostQueuedCompletionStatus() with a buffer (BytesRead) for the number of bytes read. When compiling the code with Visual Studio 2019 (v 16.3.10), we get a warning than BytesRead is not initialized. When using /RTCu (run-time checks for uninitialzed variables), the program crashes on this line with an exception. If we initialize the variable to 0, the problem is solved. PR: 63965 Submitted by: gbechis Reviewed by: gbechis,jailletc36 (+ CTR rule for non-Unix, single-platform code) Backported by: jailletc36 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1874971 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/child.c b/server/mpm/winnt/child.c index 21755f398ce..ad03d24e1c0 100644 --- a/server/mpm/winnt/child.c +++ b/server/mpm/winnt/child.c @@ -352,7 +352,7 @@ static unsigned int __stdcall winnt_accept(void *lr_) ap_listen_rec *lr = (ap_listen_rec *)lr_; apr_os_sock_info_t sockinfo; winnt_conn_ctx_t *context = NULL; - DWORD BytesRead; + DWORD BytesRead = 0; SOCKET nlsd; LPFN_ACCEPTEX lpfnAcceptEx = NULL; LPFN_GETACCEPTEXSOCKADDRS lpfnGetAcceptExSockaddrs = NULL;