Re: Fix out-of-bounds array indexing in JsonValueList

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Tristan Partin <tristan(at)partin(dot)io>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Fix out-of-bounds array indexing in JsonValueList
Date: 2026-09-29 05:50:15
Message-ID: e2322414-4437-47ce-98db-76cd4b68873b@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 29.09.26 06:04, Tristan Partin wrote:
> When compiling Postgres with -fsanitize=bounds, I get the following
> errors in the log:
>
> jsonpath_exec.c:3832:3: runtime error: index 3 out of bounds for type 'JsonbValue[2]'
> jsonpath_exec.c:3918:10: runtime error: index 3 out of bounds for type 'JsonbValue[2]'

I've run into this problem as well, but only when compiling with
-fstrict-flex-arrays=1. Is that what you are using?

I would like to get this fixed, because this site appears to be the only
problem of this kind. I will check your proposal.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ayush Tiwari 2026-09-29 05:54:27 Re: [PATCH] Table sync race with REFRESH PUBLICATION
Previous Message Peter Eisentraut 2026-09-29 05:47:22 Silence -fsanitize=function where we cast function pointers on purpose