Skip to content

fix: leftover ArkUI C ABI null deref on prepareDraw/sendMessage - #30

Open
tonycoder-hub wants to merge 1 commit into
Tencent-TDS:ov/compose-1.6.1from
tonycoder-hub:cursor/leftover-arkui-c-abi-null-1ccd
Open

fix: leftover ArkUI C ABI null deref on prepareDraw/sendMessage#30
tonycoder-hub wants to merge 1 commit into
Tencent-TDS:ov/compose-1.6.1from
tonycoder-hub:cursor/leftover-arkui-c-abi-null-1ccd

Conversation

@tonycoder-hub

Copy link
Copy Markdown

leftover

Kotlin/NAPI can pass a null render / controller during teardown or when the XComponent is missing. Sibling getId already null-guards; leftover prepareDraw / finishDraw / registerFrameCallback / unregisterFrameCallback / sendMessage dereferenced without that check and crash.

This leftover adds the same null guard and extracts a tiny helper so host tests compile without Harmony/NAPI.

Host test (no Harmony device):

compose/ui/ui-arkui/src/ohosArm64Main/cpp/compose/src/hostTest/run_leftover_c_abi_null_guard_test.sh

Signed-off-by: Tony Coder 407243179@qq.com

Kotlin/NAPI can pass null during teardown or when XComponent is
missing. leftover prepareDraw/finishDraw/registerFrameCallback/
unregisterFrameCallback and leftover sendMessage dereferenced
without the sibling getId null guard.

Extract leftover if (!p) return false helper so host tests compile
without Harmony/NAPI.

Test: leftover_c_abi_null_guard_test
Signed-off-by: Tony Coder <407243179@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant