]> git.meshlink.io Git - meshlink/commitdiff
Check return value of fread() when reading from /dev/urandom.
authorGuus Sliepen <guus@meshlink.io>
Thu, 31 Jul 2014 15:13:21 +0000 (17:13 +0200)
committerGuus Sliepen <guus@meshlink.io>
Thu, 31 Jul 2014 15:13:21 +0000 (17:13 +0200)
src/ed25519/seed.c

index 11a2e3ec460e22aa682b501fb171fbd3e9052891..dda3ccb2368af6afd77b1f3e5dc52fca47f9d812 100644 (file)
@@ -30,7 +30,9 @@ int ed25519_create_seed(unsigned char *seed) {
         return 1;
     }
 
-    fread(seed, 1, 32, f);
+    if(fread(seed, 32, 1, f) != 1)
+           return 1;
+
     fclose(f);
 #endif