9b4eff9222
The following statement is always true if read_len is unsigned: (read_len = read(fd, data_read + data_read_len, max_len - data_read_len)) > 0 Fixes: Error: INTEGER_OVERFLOW (CWE-190): [#def19] [important] libsemanage-3.7/src/direct_api.c:598:2: tainted_data_return: Called function "read(fd, data_read + data_read_len, max_len - data_read_len)", and a possible return value may be less than zero. libsemanage-3.7/src/direct_api.c:598:2: cast_underflow: An assign of a possibly negative number to an unsigned type, which might trigger an underflow. libsemanage-3.7/src/direct_api.c:599:3: overflow: The expression "data_read_len += read_len" is deemed underflowed because at least one of its arguments has underflowed. libsemanage-3.7/src/direct_api.c:598:2: overflow: The expression "max_len - data_read_len" is deemed underflowed because at least one of its arguments has underflowed. libsemanage-3.7/src/direct_api.c:598:2: overflow_sink: "max_len - data_read_len", which might have underflowed, is passed to "read(fd, data_read + data_read_len, max_len - data_read_len)". [Note: The source code implementation of the function has been overridden by a builtin model.] \# 596| } \# 597| \# 598|-> while ((read_len = read(fd, data_read + data_read_len, max_len - data_read_len)) > 0) { \# 599| data_read_len += read_len; \# 600| if (data_read_len == max_len) { Signed-off-by: Vit Mojzis <vmojzis@redhat.com> Acked-by: James Carter <jwcart2@gmail.com> |
||
---|---|---|
.. | ||
example | ||
include | ||
man | ||
src | ||
tests | ||
utils | ||
.gitignore | ||
LICENSE | ||
Makefile | ||
VERSION |