X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Frand%2Frand_win.c;h=5198351cf34ea99b562c146ad040eb9f7215ff69;hb=49436b59b505d9e49ac06e4d544d748f78689036;hp=efe0f8907059d8a4bde8a4559226fe6a26dd5776;hpb=44c8b81eea16ab0d46bce0050178de160ee72abb;p=oweals%2Fopenssl.git diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c index efe0f89070..5198351cf3 100644 --- a/crypto/rand/rand_win.c +++ b/crypto/rand/rand_win.c @@ -463,7 +463,7 @@ int RAND_poll(void) PROCESSENTRY32 p; THREADENTRY32 t; MODULEENTRY32 m; - DWORD stoptime = 0; + DWORD starttime = 0; snap = (CREATETOOLHELP32SNAPSHOT) GetProcAddress(kernel, "CreateToolhelp32Snapshot"); @@ -496,7 +496,7 @@ int RAND_poll(void) */ ZeroMemory(&hlist, sizeof(HEAPLIST32)); hlist.dwSize = sizeof(HEAPLIST32); - if (good) stoptime = GetTickCount() + MAXDELAY; + if (good) starttime = GetTickCount(); #ifdef _MSC_VER if (heaplist_first(handle, &hlist)) { @@ -527,6 +527,7 @@ int RAND_poll(void) RAND_add(&hentry, hentry.dwSize, 5); while (heap_next(&hentry) + && (!good || (GetTickCount()-starttime) 0); } } @@ -536,7 +537,7 @@ int RAND_poll(void) ex_cnt_limit--; } } while (heaplist_next(handle, &hlist) - && GetTickCount() < stoptime + && (!good || (GetTickCount()-starttime) 0); } @@ -559,7 +560,7 @@ int RAND_poll(void) && --entrycnt > 0); } } while (heaplist_next(handle, &hlist) - && GetTickCount() < stoptime); + && (!good || (GetTickCount()-starttime)