summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-02-28 21:49:58 +0100
committercyBerta <cyberta@riseup.net>2021-02-28 21:49:58 +0100
commit401e28431fcd3a093aa34d429f5bc08abca5d422 (patch)
treeb31c4d03d8c2511371184d2fe059a94fb1fd2cae /app/src/main/java/se/leap
parent69d74b6c74ce2ea31d2fad8b62a4eb983693de13 (diff)
fix potential ArrayIndexOutOfBounds Exception while trying to establish a connection with a misconfigured provider
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java
index 8c9699ca..6fffb403 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java
@@ -253,6 +253,11 @@ public class VpnConfigGenerator {
String route = "route " + ipAddress + " 255.255.255.255 net_gateway" + newLine;
stringBuilder.append(route);
}*/
+
+ if (ipAddresses.length == 0) {
+ return;
+ }
+
String ipAddress = ipAddresses[ipAddresses.length - 1];
String route = "route " + ipAddress + " 255.255.255.255 net_gateway" + newLine;
stringBuilder.append(route);