push
github
src/api.c: potential null ptr deref in cg_get_cgroups_from_proc_cgroups In function cg_get_cgroups_from_proc_cgroups there is an allocation of memory by calling malloc(buff_len). Result of this allocation is not checked, and in case of OOM it'll lead to null ptr deref. This commit adds handling of possible null ptr as a result of failed memory allocation. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com> Acked-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> (cherry picked from commit 8a40bf6f6)
1 of 4 new or added lines in 1 file covered. (25.0%)
499 existing lines in 2 files now uncovered.5577 of 9947 relevant lines covered (56.07%)
524.51 hits per line