fix: remove unsafe exec() in display_task.c#310
Merged
ruvnet merged 1 commit intoruvnet:mainfrom Apr 3, 2026
Merged
Conversation
Display buffer allocation error handling frees buf1 and buf2 pointers but does not set them to NULL Resolves V-002
ruvnet
reviewed
Apr 3, 2026
Owner
ruvnet
left a comment
There was a problem hiding this comment.
Code Review — PR #310
Recommendation: MERGE (with note)
Summary
This PR (from OrbisAI Security) fixes V-002: a use-after-free risk in display_task.c where buf1/buf2 are freed but not set to NULL in the error path. The fix adds = NULL after each free().
Security Assessment
- Fix is correct: Setting freed pointers to NULL prevents use-after-free if the function is re-entered or execution continues past the error path.
- Scope is minimal: 8 lines added, 2 removed — single file, single function. Low regression risk.
- No new attack surface introduced.
Conflict Assessment (ADR-069 through ADR-078)
- No conflicts. Our recent ADR-069 work (
a4bd2308b) touchededge_processing.candcsi_collector.c, notdisplay_task.c. The LVGL buffer allocation code has not changed since the original implementation.
Minor Notes
- The function still returns
ESP_OKafter a failed allocation (line unchanged). This is pre-existing behavior — the display is optional and failure is non-fatal. Not a blocker for this PR, but worth a follow-up to returnESP_ERR_NO_MEMinstead.
Verdict: Clean security fix. Safe to merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix high severity security issue in
firmware/esp32-csi-node/main/display_task.c.Vulnerability
V-002firmware/esp32-csi-node/main/display_task.c:116Description: Display buffer allocation error handling frees buf1 and buf2 pointers but does not set them to NULL. If display_task continues execution or is called again, these dangling pointers may be dereferen...
Changes
firmware/esp32-csi-node/main/display_task.cVerification
Automated security fix by OrbisAI Security