Skip to content

Conversation

AntonMoryakov
Copy link

The return value of _gcry_rngdrbg_cavs_test() was immediately overwritten by memcmp() result, leading to potential loss of error information. This could cause the health check to succeed even if the internal CAVS test function failed.

This issue was reported by a static analyzer:

Return value of function '_gcry_rngdrbg_cavs_test' passed to 'ret'
at random-drbg.c:2378 will be rewritten later.

To fix this, we now check the return code of _gcry_rngdrbg_cavs_test() and only call memcmp() if the test execution succeeded.

The return value of `_gcry_rngdrbg_cavs_test()` was immediately overwritten
by `memcmp()` result, leading to potential loss of error information. This
could cause the health check to succeed even if the internal CAVS test
function failed.

This issue was reported by a static analyzer:
> Return value of function '_gcry_rngdrbg_cavs_test' passed to 'ret'
> at random-drbg.c:2378 will be rewritten later.

To fix this, we now check the return code of `_gcry_rngdrbg_cavs_test()` and
only call `memcmp()` if the test execution succeeded.

Signed-off-by: Anton Moryakov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant