summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard/android
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-11-26 23:45:41 +0100
committerSamuel Holland <samuel@sholland.org>2017-11-26 23:45:41 +0100
commite421b997cd31088ca9cec96199b7acf965483eaa (patch)
treecbf3bd8a5893553a9a9841a105a0e19adc05d7c0 /app/src/main/java/com/wireguard/android
parent14a7ada6e151e45485298035bf9af0c340e9bdbf (diff)
Config: make parsing stricter
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/android')
-rw-r--r--app/src/main/java/com/wireguard/android/backends/VpnService.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/android/backends/VpnService.java b/app/src/main/java/com/wireguard/android/backends/VpnService.java
index 084a2407..95736de5 100644
--- a/app/src/main/java/com/wireguard/android/backends/VpnService.java
+++ b/app/src/main/java/com/wireguard/android/backends/VpnService.java
@@ -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);
}
}