From e7f00f63486c7aee45b5770a83bfd9e37f794b65 Mon Sep 17 00:00:00 2001 From: Leo fernandes Date: Wed, 21 Jan 2026 15:00:59 -0300 Subject: [PATCH] java: add explicit null check in BrotliInputStream.read --- java/org/brotli/dec/BrotliInputStream.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/org/brotli/dec/BrotliInputStream.java b/java/org/brotli/dec/BrotliInputStream.java index 83ecc56..3e640b1 100644 --- a/java/org/brotli/dec/BrotliInputStream.java +++ b/java/org/brotli/dec/BrotliInputStream.java @@ -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) {