randfile.c: fix a Coverity warning
authorDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Sun, 28 Oct 2018 12:32:11 +0000 (13:32 +0100)
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Sun, 28 Oct 2018 22:39:13 +0000 (23:39 +0100)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7510)

(cherry picked from commit 040a03470c7c5bf95fe8e6143db7bef357a22833)

crypto/rand/randfile.c

index 45d20e5..1b737d1 100644 (file)
@@ -110,7 +110,7 @@ int RAND_load_file(const char *file, long bytes)
 
     if (bytes < 0) {
         if (S_ISREG(sb.st_mode))
-            bytes = (sb.st_size <= LONG_MAX) ? sb.st_size : LONG_MAX;
+            bytes = sb.st_size;
         else
             bytes = RAND_DRBG_STRENGTH;
     }