From 401e28431fcd3a093aa34d429f5bc08abca5d422 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sun, 28 Feb 2021 21:49:58 +0100 Subject: fix potential ArrayIndexOutOfBounds Exception while trying to establish a connection with a misconfigured provider --- app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/src/main/java') 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); -- cgit v1.2.3