Re: BUG #19405: Assertion in eval_windowaggregates() fails due to integer overflow

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19405: Assertion in eval_windowaggregates() fails due to integer overflow
Date: 2026-02-14 13:44:48
Message-ID: CAMbWs4-i9Hk8+fyxoT88ixbrBYuT+2=d9nLqFLi8jfS3k_z68w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Feb 14, 2026 at 8:00 PM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
> Right, I noticed this one too. Basically, nodeWindowAgg.c doesn't
> check for overflow when adding startOffsetValue or endOffsetValue.
> Since these values are provided by the user and can be arbitrarily
> large, simple addition does not seem safe. I think we may need to
> switch to overflow-aware integer operations in all relevant code.

Here is an updated patch to fix all relevant code in nodeWindowAgg.c.

- Richard

Attachment Content-Type Size
v2-0001-Fix-signed-integer-overflow-in-nodeWindowAgg.c.patch application/octet-stream 4.3 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrey Borodin 2026-02-14 16:18:39 Re: 17.8 standby crashes during WAL replay from 17.5 primary: "could not access status of transaction"
Previous Message Heikki Linnakangas 2026-02-14 11:42:02 Re: 17.8 standby crashes during WAL replay from 17.5 primary: "could not access status of transaction"