RAND_egd_bytes: No need to check RAND_status on connection error.
authorganesh <ganeshbhambarkar@gmail.com>
Fri, 11 Nov 2016 03:13:13 +0000 (08:43 +0530)
committerRichard Levitte <levitte@openssl.org>
Tue, 24 Jan 2017 13:39:20 +0000 (14:39 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1886)

crypto/rand/rand_egd.c

index f77af415c016f47022d3534bd698e113b0440f00..dd58b214981efd3d1d4fbf4e0f537e9da2a69959 100644 (file)
@@ -231,6 +231,8 @@ int RAND_egd_bytes(const char *path, int bytes)
     int num, ret = -1;
 
     num = RAND_query_egd_bytes(path, NULL, bytes);
     int num, ret = -1;
 
     num = RAND_query_egd_bytes(path, NULL, bytes);
+    if (num < 0)
+        goto err;
     if (RAND_status() == 1)
         ret = num;
  err:
     if (RAND_status() == 1)
         ret = num;
  err: