java: add explicit null check in BrotliInputStream.read

This commit is contained in:
Leo fernandes
2026-01-21 15:00:59 -03:00
parent 5fa73e23be
commit e7f00f6348

View File

@@ -139,6 +139,9 @@ public class BrotliInputStream extends InputStream {
*/
@Override
public int read(byte[] destBuffer, int destOffset, int destLen) throws IOException {
if (destBuffer == null) {
throw new NullPointerException("destBuffer is null");
}
if (destOffset < 0) {
throw new IllegalArgumentException("Bad offset: " + destOffset);
} else if (destLen < 0) {