Avoid uninitialized variable warning in entropy_gather_internal
The variable ret was always initialized in entropy_gather_internal,
but `gcc -Werror=maybe-uninitialized` rightfully complained that it
was unable to determine this statically. Therefore, tweak the
problematic case (ctx->source_count == 0) to not use ret in that case.
diff --git a/library/entropy.c b/library/entropy.c
index 5a8321b..518d982 100644
--- a/library/entropy.c
+++ b/library/entropy.c
@@ -196,13 +196,11 @@
*/
static int entropy_gather_internal( entropy_context *ctx )
{
- int ret, i;
+ int ret = POLARSSL_ERR_ENTROPY_NO_SOURCES_DEFINED;
+ int i;
unsigned char buf[ENTROPY_MAX_GATHER];
size_t olen;
- if( ctx->source_count == 0 )
- return( POLARSSL_ERR_ENTROPY_NO_SOURCES_DEFINED );
-
/*
* Run through our entropy sources
*/