]> git.ipfire.org Git - thirdparty/systemd.git/commit
random-util: always cast from smaller to bigger type when comparing
authorLennart Poettering <lennart@poettering.net>
Tue, 11 Jul 2017 08:35:47 +0000 (10:35 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 11 Jul 2017 08:37:40 +0000 (10:37 +0200)
commit7b54715d19daeb2768362f4fc0d5192ed8af3ced
treeaa0565ca5c2e21bfc234e6087d4cd15bc2a4c227
parentf3b57eaf4591eee1b557b70493c2575859305b02
random-util: always cast from smaller to bigger type when comparing

When we compare two size values, let's make sure we cast from the
smaller to the bigger type first, if both types differ, rather than the
reverse in order to not run into overflows.
src/basic/random-util.c