Open
Conversation
Greptile SummaryThis PR corrects a latent
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| centrallix/wgtr/wgtr.c | Single-line correctness fix: strtcpy for node->Type now uses sizeof(node->Type) instead of sizeof(node->Name). Both fields are currently 64 bytes in WgtrNode, so no actual overflow existed, but the fix correctly ties the size guard to the destination buffer and prevents latent risk if field sizes ever diverge. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[wgtrNewNode called\nname, type, geometry args] --> B{nmMalloc succeeds?}
B -- No --> C[mssError + return NULL]
B -- Yes --> D[memset node to 0\nSETMAGIC]
D --> E[strtcpy node->Name, name,\nsizeof node->Name]
E --> F["strtcpy node->Type, type,\nsizeof(node->Type)\n✅ FIXED: was sizeof(node->Name)"]
F --> G[snprintf node->DName\nwith SerialID]
G --> H[Set geometry fields\nr_x r_y width height etc.]
H --> I[xaInit Properties\nChildren Interfaces]
I --> J[return node]
Last reviewed commit: 67d2a4b
Contributor
Author
|
PR cleared for human review. |
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.
Fix bugs I came across that don't fit into any other PRs. Should be very easy to review.
Current fixes:
wgtr.c.