httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: cvs commit: apache-2.0/src/lib/apr/misc/win32 rand.c
Date Wed, 20 Sep 2000 15:07:43 GMT
wrowe@locus.apache.org writes:

>   Index: rand.c
>   ===================================================================
>   RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/win32/rand.c,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- rand.c	2000/08/02 05:26:24	1.5
>   +++ rand.c	2000/09/20 14:55:54	1.6
>   @@ -64,7 +64,9 @@
>    	return GetLastError();
>        }
>        if (!CryptGenRandom(hProv,length,buf)) {
>   -	return GetLastError();
>   +        CryptReleaseContext(hProv, 0);
>   +    	return GetLastError();
>        }
>   +    CryptReleaseContext(hProv, 0);
>        return APR_SUCCESS;
>    }

:silly lvl=max.
Perhaps save GetLastError() over the call to CryptReleaseContext()?

If CryptGenRandom() fails and CryptReleaseContext() also
fails, you return the CryptReleaseContext() failure.

If CryptGenRandom() succeeds and CryptReleaseContext() fails, you
return APR_SUCCESS.
:esilly.

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message