You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by iv...@apache.org on 2019/06/11 16:39:38 UTC
svn commit: r1861046 - /apr/apr/trunk/misc/win32/misc.c
Author: ivan
Date: Tue Jun 11 16:39:38 2019
New Revision: 1861046
URL: http://svn.apache.org/viewvc?rev=1861046&view=rev
Log:
* misc/win32/misc.c
(apr_get_oslevel): Do not use static variables to protect from potential
race condition.
Modified:
apr/apr/trunk/misc/win32/misc.c
Modified: apr/apr/trunk/misc/win32/misc.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/misc/win32/misc.c?rev=1861046&r1=1861045&r2=1861046&view=diff
==============================================================================
--- apr/apr/trunk/misc/win32/misc.c (original)
+++ apr/apr/trunk/misc/win32/misc.c Tue Jun 11 16:39:38 2019
@@ -27,7 +27,7 @@ apr_status_t apr_get_oslevel(apr_oslevel
{
if (apr_os_level == APR_WIN_UNK)
{
- static OSVERSIONINFO oslev;
+ OSVERSIONINFO oslev;
oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (!GetVersionEx(&oslev)) {
return apr_get_os_error();
@@ -35,7 +35,7 @@ apr_status_t apr_get_oslevel(apr_oslevel
if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT)
{
- static unsigned int servpack = 0;
+ unsigned int servpack = 0;
TCHAR *pservpack;
if ((pservpack = oslev.szCSDVersion)) {
while (*pservpack && !apr_isdigit(*pservpack)) {