575d1cfaac
In case of malloc error, ctx1, or ctx2 may be pointing to uninitialized space and context_destroy should not be used on it. Fixes: Error: UNINIT (CWE-457): libsepol-3.7/src/mls.c:673:2: alloc_fn: Calling "malloc" which returns uninitialized memory. libsepol-3.7/src/mls.c:673:2: assign: Assigning: "ctx1" = "malloc(64UL)", which points to uninitialized data. libsepol-3.7/src/mls.c:699:2: uninit_use_in_call: Using uninitialized value "ctx1->range.level[0].cat.node" when calling "context_destroy". \# 697| ERR(handle, "could not check if mls context %s contains %s", \# 698| mls1, mls2); \# 699|-> context_destroy(ctx1); \# 700| context_destroy(ctx2); \# 701| free(ctx1); Error: UNINIT (CWE-457): libsepol-3.7/src/mls.c:674:2: alloc_fn: Calling "malloc" which returns uninitialized memory. libsepol-3.7/src/mls.c:674:2: assign: Assigning: "ctx2" = "malloc(64UL)", which points to uninitialized data. libsepol-3.7/src/mls.c:700:2: uninit_use_in_call: Using uninitialized value "ctx2->range.level[0].cat.node" when calling "context_destroy". \# 698| mls1, mls2); \# 699| context_destroy(ctx1); \# 700|-> context_destroy(ctx2); \# 701| free(ctx1); \# 702| free(ctx2); Signed-off-by: Vit Mojzis <vmojzis@redhat.com> Acked-by: James Carter <jwcart2@gmail.com> |
||
---|---|---|
.. | ||
cil | ||
fuzz | ||
include | ||
man | ||
src | ||
tests | ||
utils | ||
.gitignore | ||
LICENSE | ||
Makefile | ||
VERSION |