make the fread() success-check code in Sys_RandomBytes() more secure

This commit is contained in:
/dev/humancontroller authored and Zack Middleton committed 2013-05-30 15:41:19 -05:00
1 parent f0b43aba35
commit a8ce30163e
1 file changed
+1 -1
+1 -1
View File
@@ -123,7 +123,7 @@ qboolean Sys_RandomBytes( byte *string, int len )
if( !fp )
return qfalse;
if( !fread( string, sizeof( byte ), len, fp ) )
if( fread( string, sizeof( byte ), len, fp ) != len )
{
fclose( fp );
return qfalse;