You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2020/03/08 10:29:54 UTC

svn commit: r1874971 - /httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c

Author: jailletc36
Date: Sun Mar  8 10:29:54 2020
New Revision: 1874971

URL: http://svn.apache.org/viewvc?rev=1874971&view=rev
Log:
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

Modified:
    httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c

Modified: httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c?rev=1874971&r1=1874970&r2=1874971&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c (original)
+++ httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c Sun Mar  8 10:29:54 2020
@@ -352,7 +352,7 @@ static unsigned int __stdcall winnt_acce
     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;