On Sep 26, 2021, at 18:31, Tom Lane <t...@sss.pgh.pa.us> wrote:

> I'd bet more along the lines of "your overflow check is less portable than
> you thought”.

Oh well now that you mention it and I look past things, I see we’re using 
INT_MAX, but should probably use INT32_MAX.

  
https://github.com/theory/pg-semver/blob/87cc30cbe80aa3992a4af6f19a35a9441111a86c/src/semver.c#L145-L149

And also that the destination value we’re storing it in is an int parts[], not 
int32 parts[]. Which we do so we can parse numbers up to int size. But to 
Fetter’s point, we’re not properly handling something greater than int (usually 
int64, presumably). Not sure what changes are required to improve memory safety 
over and above using INT32_MAX instead of INT_MAX.

Thanks,

Daavid

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to