changeset 736:0b854ab00333

merge
author Matt Johnston <matt@ucc.asn.au>
date Tue, 02 Apr 2013 18:54:04 +0800
parents 73b6e5d8801b (diff) 619b1ed837fd (current diff)
children 7deb6fda1319 077bbe1eb220
files
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/random.c	Tue Apr 02 00:11:53 2013 +0800
+++ b/random.c	Tue Apr 02 18:54:04 2013 +0800
@@ -157,6 +157,9 @@
 	/* This is opportunistic, don't worry about failure */
 	unsigned char buf[INIT_SEED_SIZE];
 	FILE *f = fopen(DROPBEAR_URANDOM_DEV, "w");
+    if (!f) {
+        return;
+    }
 	genrandom(buf, sizeof(buf));
 	fwrite(buf, sizeof(buf), 1, f);
 	fclose(f);