platform_external_selinux/libsepol
Christian Göttsche 44d56761be
libsepol: avoid unsigned integer overflow
Unsigned integer overflow is well-defined and not undefined behavior.
It is commonly used for hashing or pseudo random number generation.
But it is still useful to enable undefined behavior sanitizer checks on
unsigned arithmetic to detect possible issues on counters or variables
with similar purpose or missed overflow checks on user input.

Use a spaceship operator like comparison instead of subtraction.

    policydb.c:851:24: runtime error: unsigned integer overflow: 801 - 929 cannot be represented in type 'unsigned int'

Follow-up of: 1537ea8412 ("libsepol: avoid unsigned integer overflow")

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2021-07-13 21:00:33 +02:00
..
cil libsepol/cil: Improve checking for bad inheritance patterns 2021-07-07 12:29:15 -04:00
include libsepol: mark read-only parameters of type_set_ interfaces const 2021-06-24 09:40:24 -04:00
man selinux: Update manpages after removing legacy boolean and user code 2019-07-29 23:46:47 +02:00
src libsepol: avoid unsigned integer overflow 2021-07-13 21:00:33 +02:00
tests libsepol: silence -Wextra-semi-stmt warning 2021-07-06 11:08:11 -04:00
utils libsepol: build: follow standard semantics for DESTDIR and PREFIX 2018-02-14 15:59:36 +01:00
.gitignore libsepol: build cil into libsepol 2014-08-26 08:03:31 -04:00
COPYING initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile libsepol: build cil into libsepol 2014-08-26 08:03:31 -04:00
VERSION Update VERSIONs to 3.2 for release. 2021-03-04 16:42:59 +01:00