Message-ID: From: "Sasasu (@Sasasu)" To: "pgjdbc/pgjdbc" Date: Fri, 24 Jan 2025 09:16:06 +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: Sasasu X-GitHub-Comment-Id: 1928372613 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_r1928372613 Content-Type: text/plain; charset=utf-8 (on pgjdbc/src/main/java/org/postgresql/gss/GSSOutputStream.java) `token.length` may comes from a bigger buffer, `gssContext.wrap` will encode `b[off: off + len]` and return `b` as `token`. if `b` is bigger than `len`, `writeWrapped()` will wirte an incorrect length.