[Rpm-maint] [rpm-software-management/rpm] Use int64_t for lengths (#1492)

Panu Matilainen notifications at github.com
Wed Feb 24 09:42:24 UTC 2021


Not sure if the earlier versions had those comments in dataLength(), if they did then apologies for missing. Scratch them, otherwise we'll end up having a comment on every other row of the code. A simple remark like "note use of 64bit types to avoid overflow" before the function body is more than enough.

However I have a growing uneasy feeling that we've long since gotten lost in the weeds.

We're talking about data that is capped to 256MB total. We're *nowhere near* the overflow points of 32bit ints, whether signed or not. So actually the direction of #1493 is probably a far saner approach, only the rationale is backwards and misses the actual point (and so I missed it too): the check is in the wrong place entirely. regionSwab() is "inner sanctum" already and shouldn't have to check the data type basics, that is already done earlier, except that it's not for the count at the moment.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1492#issuecomment-784946785
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210224/92e1dd00/attachment.html>


More information about the Rpm-maint mailing list