Conversation
We're accessing the notify_active pointer from multiple contexts: WS callback, button cancel callback, and notify_task. Without synchronization, a task could dereference the pointer while another task is freeing it, causing a use-after-free. Add a mutex guard to prevent this. Reported-by: Claude Opus 4.6 <noreply@anthropic.com>
notify_active and nd point to the same memory. Freeing nd before clearing notify_active leaves a dangling pointer that another task could dereference. Clear the pointer first to prevent use-after-free. Reported-by: Claude Opus 4.6 <noreply@anthropic.com>
The cancel button could be pressed after the notify task has already finished and cleared notify_active. Check for NULL to avoid a null pointer dereference. Reported-by: Claude Opus 4.6 <noreply@anthropic.com>
The volatile keyword only tells the compiler to not cache the variable in a register, but to always read from memory. It does not guarantee visibility across cores, memory ordering, or atomicity. As the ESP32-S3 is dual-core, use _Atomic to ensure correctness when accessing these variables from different tasks. Reported-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
No description provided.