mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
[PR #1413] java: add explicit null check in BrotliInputStream.read #2022
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/google/brotli/pull/1413
Author: @leofernandesmo
Created: 1/21/2026
Status: 🔄 Open
Base:
master← Head:fix-java-brotliinputstream-null-buffer📝 Commits (1)
e7f00f6java: add explicit null check in BrotliInputStream.read📊 Changes
1 file changed (+3 additions, -0 deletions)
View changed files
📝
java/org/brotli/dec/BrotliInputStream.java(+3 -0)📄 Description
Problem: BrotliInputStream.read(byte[], int, int) currently dereferences destBuffer.length during bounds checking, so passing a null buffer triggers a NullPointerException from the dereference rather than an explicit parameter check.
Why change: InputStream.read(byte[], int, int) specifies NullPointerException when the buffer argument is null, so this change preserves the expected exception type while making the failure mode explicit and easier to diagnose.
Repro:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.