File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -946,7 +946,7 @@ static int uuid_from_dmi_entries(char *system_uuid)
946946 int f ;
947947 DIR * d ;
948948 struct dirent * de ;
949- char buf [512 ];
949+ char buf [512 ] = { 0 } ;
950950
951951 system_uuid [0 ] = '\0' ;
952952 d = opendir (PATH_DMI_ENTRIES );
@@ -964,7 +964,7 @@ static int uuid_from_dmi_entries(char *system_uuid)
964964 continue ;
965965 len = read (f , buf , 512 );
966966 close (f );
967- if (len < 0 )
967+ if (len <= 0 )
968968 continue ;
969969 if (sscanf (buf , "%d" , & type ) != 1 )
970970 continue ;
@@ -976,7 +976,7 @@ static int uuid_from_dmi_entries(char *system_uuid)
976976 continue ;
977977 len = read (f , buf , 512 );
978978 close (f );
979- if (len < 0 )
979+ if (len <= 0 )
980980 continue ;
981981 /* Sigh. https://en.wikipedia.org/wiki/Overengineering */
982982 /* DMTF SMBIOS 3.0 Section 7.2.1 System UUID */
You can’t perform that action at this time.
0 commit comments