Add return and null check for preventing invalid memory access 46/278546/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 22 Jul 2022 01:25:28 +0000 (10:25 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Fri, 22 Jul 2022 01:25:28 +0000 (10:25 +0900)
commitae78b49ef4b2373e8937f7be69ccd56942d3ffc2
treec24dc69f11d00658449958fe7d7fd35f5a99ae98
parent818ed8dd01677a7d9485f7aa991d6ccf1d790785
Add return and null check for preventing invalid memory access

- Issue:
Sometimes, the code may access invalid memory when the function frees
unused memory.

- Solution:
This is because the logic for free Object_Info structure does not check
whether the pointer is not null. There is missing 'return' on 'next'
label, so sometime the code flow can allow freeing members of
Object_Info structure even if the structure still has no memory.
This patch adds missing 'return' expression and null checker for
'object_info'. Through this change, code prevents invalid memory access.

Change-Id: I02d0652f6e3dfb4a8aa6fa0dc25735eac25dc884
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
src/vc_elm_efl_dump.c