diff random.c @ 801:7dcb46da72d9 ecc

merge in HEAD
author Matt Johnston <matt@ucc.asn.au>
date Tue, 21 May 2013 12:09:35 +0800
parents ac2158e3e403 7deb6fda1319
children 4095b6d7c9fc
line wrap: on
line diff
--- a/random.c	Thu May 09 23:27:23 2013 +0800
+++ b/random.c	Tue May 21 12:09:35 2013 +0800
@@ -158,6 +158,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);