diff options
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/LogItem.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/LogItem.java b/main/src/main/java/de/blinkt/openvpn/core/LogItem.java index 57bc3e1e..d767e073 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/LogItem.java +++ b/main/src/main/java/de/blinkt/openvpn/core/LogItem.java @@ -151,6 +151,8 @@ public class LogItem implements Parcelable { if (len == 0) { mMessage = null; } else { + if (len > bb.remaining()) + throw new IndexOutOfBoundsException("String length " + len + " is bigger than remaining bytes " + bb.remaining()); byte[] utf8bytes = new byte[len]; bb.get(utf8bytes); mMessage = new String(utf8bytes, "UTF-8"); |