Config: make parsing stricter

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2017-11-26 23:45:41 +01:00
committed by Samuel Holland
parent 14a7ada6e1
commit e421b997cd
4 changed files with 19 additions and 6 deletions
@@ -369,6 +369,11 @@ public class VpnService extends Service
config.setName(configName);
configs.add(config);
} catch (IllegalArgumentException | IOException e) {
try {
file.delete();
} catch (Exception e2) {
Log.w(TAG, "Could not remove " + fileName, e2);
}
Log.w(TAG, "Failed to load config from " + fileName, e);
}
}