feat(core): add lv_check_arg to public functions in lv_observer#10203
feat(core): add lv_check_arg to public functions in lv_observer#10203axos88 wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi 👋, thank you for your PR! We've run benchmarks in an emulated environment. Here are the results: ARM Emulated 32b - lv_conf_perf32b
Detailed Results Per Scene
ARM Emulated 64b - lv_conf_perf64b
Detailed Results Per Scene
Disclaimer: These benchmarks were run in an emulated environment using QEMU with instruction counting mode. 🤖 This comment was automatically generated by a bot. |
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/core/lv_observer.c">
<violation number="1" location="src/core/lv_observer.c:512">
P2: Allowing `subject == NULL` here opens a path where `lv_obj_remove_event_cb_with_user_data(obj, NULL, subject)` becomes `...user_data == NULL`, which can remove unrelated callbacks from the widget.
(Based on your team's feedback about documented NULL semantics for `lv_obj_remove_from_subject`.) [FEEDBACK_USED]</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| { | ||
| LV_CHECK_ARG(obj != NULL, return); | ||
| LV_CHECK_ARG(subject != NULL, return); | ||
| /* subject == NULL is documented as valid: remove from ALL subjects */ |
There was a problem hiding this comment.
P2: Allowing subject == NULL here opens a path where lv_obj_remove_event_cb_with_user_data(obj, NULL, subject) becomes ...user_data == NULL, which can remove unrelated callbacks from the widget.
(Based on your team's feedback about documented NULL semantics for lv_obj_remove_from_subject.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/core/lv_observer.c, line 512:
<comment>Allowing `subject == NULL` here opens a path where `lv_obj_remove_event_cb_with_user_data(obj, NULL, subject)` becomes `...user_data == NULL`, which can remove unrelated callbacks from the widget.
(Based on your team's feedback about documented NULL semantics for `lv_obj_remove_from_subject`.) </comment>
<file context>
@@ -502,7 +509,8 @@ void lv_observer_remove(lv_observer_t * observer)
{
LV_CHECK_ARG(obj != NULL, return);
- LV_CHECK_ARG(subject != NULL, return);
+ /* subject == NULL is documented as valid: remove from ALL subjects */
+
/*
</file context>
Summary
Add
LV_CHECK_ARGguards to previously unguarded parameters in public API functions insrc/core/lv_observer.c. This PR adds parameter validation to 7 functions and fixes 1 validation issue.Functions modified
void lv_subject_init_int(lv_subject_t * subject, int32_t value)subjectvaluevoid lv_subject_init_string(lv_subject_t * subject, char * buf, char * tmp_buf, uint32_t size, const char * value)subjectbufsizesize == 0makes subject permanently unusablevalueGenerated with Claude Code