@@ -137,7 +137,7 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
137137 size_t entropy_available = 0 ;
138138 RAND_POOL * pool ;
139139
140- if (drbg -> parent && drbg -> strength > drbg -> parent -> strength ) {
140+ if (drbg -> parent != NULL && drbg -> strength > drbg -> parent -> strength ) {
141141 /*
142142 * We currently don't support the algorithm from NIST SP 800-90C
143143 * 10.1.2 to use a weaker DRBG as source
@@ -155,7 +155,7 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
155155 return 0 ;
156156 }
157157
158- if (drbg -> parent ) {
158+ if (drbg -> parent != NULL ) {
159159 size_t bytes_needed = rand_pool_bytes_needed (pool , 1 /*entropy_factor*/ );
160160 unsigned char * buffer = rand_pool_add_begin (pool , bytes_needed );
161161
@@ -235,7 +235,7 @@ size_t rand_drbg_get_nonce(RAND_DRBG *drbg,
235235 struct {
236236 void * instance ;
237237 int count ;
238- } data = { 0 };
238+ } data = { NULL , 0 };
239239
240240 pool = rand_pool_new (0 , min_len , max_len );
241241 if (pool == NULL )
@@ -402,7 +402,7 @@ int RAND_poll(void)
402402 } else {
403403 /* fill random pool and seed the current legacy RNG */
404404 pool = rand_pool_new (RAND_DRBG_STRENGTH ,
405- RAND_DRBG_STRENGTH / 8 ,
405+ ( RAND_DRBG_STRENGTH + 7 ) / 8 ,
406406 RAND_POOL_MAX_LENGTH );
407407 if (pool == NULL )
408408 return 0 ;
@@ -689,7 +689,7 @@ unsigned char *rand_pool_add_begin(RAND_POOL *pool, size_t len)
689689
690690 if (pool -> buffer == NULL ) {
691691 RANDerr (RAND_F_RAND_POOL_ADD_BEGIN , ERR_R_INTERNAL_ERROR );
692- return 0 ;
692+ return NULL ;
693693 }
694694
695695 return pool -> buffer + pool -> len ;
0 commit comments