[PATCH] Fix possible overflow on tuplesort.c

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] Fix possible overflow on tuplesort.c
Date: 2020-04-16 23:54:32
Message-ID: CAEudQAqY_DtfrKMD+ZbGNcEPf5-QK=8FA=BYX=Hd3wFTDEEOFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

When multiplying variables, the overflow will take place anyway, and only
then will the meaningless product be explicitly promoted to type int64.
It is one of the operands that should have been cast instead to avoid the
overflow.

regards,
Ranier Vilela

Attachment Content-Type Size
tuplesort_avoid_possible_overflow.patch application/octet-stream 584 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-04-17 00:25:09 Re: Poll: are people okay with function/operator table redesign?
Previous Message Tomas Vondra 2020-04-16 23:13:00 Re: sqlsmith crash incremental sort