[PATCH] Fix possible overflow on tuplesort.c - Mailing list pgsql-hackers

From Ranier Vilela
Subject [PATCH] Fix possible overflow on tuplesort.c
Date
Msg-id CAEudQAqY_DtfrKMD+ZbGNcEPf5-QK=8FA=BYX=Hd3wFTDEEOFg@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Fix possible overflow on tuplesort.c  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List 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

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: sqlsmith crash incremental sort
Next
From: Tom Lane
Date:
Subject: Re: Poll: are people okay with function/operator table redesign?