"long int" on at least x86 Linux is exactly the same as a plain 
"int", so calculations can easily overflow. 32bit systems are not 
expected to have hundreds of gigabytes of memory but a 32bit process on a 
x86_64 can run into all sorts of funny things, such having 500GB system memory. 
At which point the type capable of addressing all of process memory is 
absolutely useless for calculating the total memory.

Use uint64_t in the memory calculations to make the size explicit. Of course 
one day we may cross that border too, but I hope to be retired by then.

Fixes https://issues.redhat.com/browse/RHEL-16557
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/2770

-- Commit Summary --

  * Fix integer overflow in memory calculations on 32bit systems

-- File Changes --

    M rpmio/macro.c (20)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/2770.patch
https://github.com/rpm-software-management/rpm/pull/2770.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2770
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to