[nodiscard] Fix all winpr_RAND usages

* Check return value and act on it.
* Initialize arrays that were missed before.
This commit is contained in:
Armin Novak
2026-02-27 07:33:51 +01:00
parent 56d4139e6d
commit 89ab3c6c1b
50 changed files with 378 additions and 190 deletions

View File

@@ -328,7 +328,12 @@ fail:
static BYTE prand(void)
{
BYTE tmp = 0;
winpr_RAND(&tmp, sizeof(tmp));
if (winpr_RAND(&tmp, sizeof(tmp)) < 0)
{
(void)fprintf(stderr, "winpr_RAND faild,retry...\n");
// NOLINTNEXTLINE(concurrency-mt-unsafe)
exit(-1);
}
return tmp;
}