Mailing List Archive

Bug: Error using GetProcessWorkingSetSize
Hi,

The out parameters for the Win32 API call GetProcessWorkingSetSize are
defined incorrectly in
random/rndw32.c<http://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=blob_plain;f=random/rndw32.c;hb=HEAD>.
The parameters minimumWorkingSetSize and maximumWorkingSetSize should be
declared to be of type SIZE_T, not DWORD. See
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683226%28v=vs.85%29.aspx.
On Windows x64, SIZE_T is 64 bits wide, so the call can end up
erroneously overwriting part of the stack, causing a crash.

Cheers,
Mann Ern
Re: Bug: Error using GetProcessWorkingSetSize [ In reply to ]
On Tue, 15 May 2012 09:55, mann.ern.kang@gmail.com said:

> On Windows x64, SIZE_T is 64 bits wide, so the call can end up
> erroneously overwriting part of the stack, causing a crash.

Again: You may not use Libgcrypt for 64 bit - the RNG is not up to that.
Changing the types of certain variables is not a solution.


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: Bug: Error using GetProcessWorkingSetSize [ In reply to ]
Ah, my apologies, was not aware of this limitation. Should have checked the
mailing list archives first. Thanks for the clarification.

Cheers,
Mann Ern

On Tue, May 15, 2012 at 7:23 PM, Werner Koch <wk@gnupg.org> wrote:

> On Tue, 15 May 2012 09:55, mann.ern.kang@gmail.com said:
>
> > On Windows x64, SIZE_T is 64 bits wide, so the call can end up
> > erroneously overwriting part of the stack, causing a crash.
>
> Again: You may not use Libgcrypt for 64 bit - the RNG is not up to that.
> Changing the types of certain variables is not a solution.
>
>
> Salam-Shalom,
>
> Werner
>
> --
> Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.
>
>