Root cause (CWE-190/CWE-130): the length-encoded integer decoder used while parsing server-controlled packets read the 0xFE form as an unsigned 8-byte value and cast it straight to a Java int (return (int) readLong();) without verifying it fit a non-negative int. Because every caller uses the returned value as a length/count (buffer allocation, sub-packet sizing, readBytes, string/blob reads), a malicious or MITM server could send a value > Integer.MAX_VALUE that wrapped to a negative or unrelated length, producing NegativeArraySizeException, out-of-bounds reads, or oversized allocations. The fix adds a bounds check (if (val < 0 || val > Integer.MAX_VALUE) throw new IllegalArgumentException(...)) in exactly two methods: readIntLengthEncodedNotNull() and readLength(). The class layout differs per affected line: on 3.5.x ReadableByteBuf is a single final class (org.mariadb.jdbc.client.ReadableByteBuf), while on 3.3.x/3.4.x ReadableByteBuf is an interface and the implementation lives in org.mariadb.jdbc.client.impl.StandardReadableByteBuf. Both variants existed in the vulnerable versions and both contained the unchecked (int) readLong() in the 0xFE branch, so the vulnerable runtime functions are readIntLengthEncodedNotNull() and readLength() in each of those classes.