rand/randfile.c: treat empty string in RAND_file_name as error.
authorAndy Polyakov <appro@openssl.org>
Tue, 20 Sep 2016 15:08:03 +0000 (17:08 +0200)
committerAndy Polyakov <appro@openssl.org>
Wed, 21 Sep 2016 19:09:11 +0000 (21:09 +0200)
Suggested in GH#1589.

Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/rand/randfile.c

index dfec2c7d6b128cd9eddf555c0ffef4cd72870cf7..c96383a431ad28d3357137d27688504415ec8203 100644 (file)
@@ -362,5 +362,5 @@ const char *RAND_file_name(char *buf, size_t size)
             return NULL;
         }
 #endif
-    return buf;
+    return buf[0] ? buf : NULL;
 }