error-check reading of old uidvalidity and maxuid files
found by coverity.
This commit is contained in:
parent
2d4bc1e613
commit
09db83809a
|
@ -128,13 +128,21 @@ convert( config_t *box )
|
|||
sys_error( "Cannot open %s", iuvname );
|
||||
goto err2;
|
||||
}
|
||||
fscanf( fp, "%d", &uidval );
|
||||
if (fscanf( fp, "%d", &uidval ) != 1) {
|
||||
sys_error( "Cannot read %s", iuvname );
|
||||
err3:
|
||||
fclose( fp );
|
||||
goto err2;
|
||||
}
|
||||
fclose( fp );
|
||||
if (!(fp = fopen( imuname, "r" ))) {
|
||||
sys_error( "Cannot open %s", imuname );
|
||||
goto err2;
|
||||
}
|
||||
fscanf( fp, "%d", &maxuid );
|
||||
if (fscanf( fp, "%d", &maxuid ) != 1) {
|
||||
sys_error( "Cannot read %s", imuname );
|
||||
goto err3;
|
||||
}
|
||||
fclose( fp );
|
||||
|
||||
if (!stat( iumname, &sb )) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user