Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Fri, 24 Jan 2025 09:25:49 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3492: fix: ArrayIndexOutOfBounds when write big object into GSS enabled connection In-Reply-To: References: List-Id: X-GitHub-Author-Login: vlsi X-GitHub-Comment-Id: 1928386658 X-GitHub-Comment-Type: review_comment X-GitHub-Commit: b6281eaaf88f3471a04bec5339fe92847ccad28c X-GitHub-Issue: 3492 X-GitHub-Path: pgjdbc/src/main/java/org/postgresql/gss/GSSOutputStream.java X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: review_comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3492#discussion_r1928386658 Content-Type: text/plain; charset=utf-8 (on pgjdbc/src/main/java/org/postgresql/gss/GSSOutputStream.java) Remember: we write the data to the `pgOut` stream here, and we should write `length + contents`. The contents is `token` byte array which is a **new** array, and it has nothing to do with `b`/`buf`. Why have you replaced `len`?