diff options
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/fragments/Utils.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java index 606ea5f2..d3c2bdcb 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java @@ -199,8 +199,12 @@ public class Utils { int nRead; byte[] data = new byte[16384]; - while ((nRead = input.read(data, 0, data.length)) != -1) { + ; + + long totalread = 0; + while ((nRead = input.read(data, 0, data.length)) != -1 && totalread <VpnProfile.MAX_EMBED_FILE_SIZE ) { buffer.write(data, 0, nRead); + totalread+=nRead; } buffer.flush(); |