Browse Source

error-check reading of old uidvalidity and maxuid files

found by coverity.
1.1
Oswald Buddenhagen 11 years ago
parent
commit
09db83809a
  1. 12
      src/compat/convert.c

12
src/compat/convert.c

@ -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…
Cancel
Save