Fix Potential Buffer Overflow#92
Conversation
Greptile SummaryThis PR fixes a copy-paste error in Confidence Score: 5/5This PR is safe to merge — it is a minimal, correct bug fix with no adverse side effects. Single-line change correcting the wrong No files require special attention.
|
| Filename | Overview |
|---|---|
| centrallix/wgtr/wgtr.c | Single-line fix: corrects sizeof(node->Name) → sizeof(node->Type) in strtcpy call for node->Type. Both fields happen to be char[64], so no real overflow was occurring, but the fix removes a latent risk if field sizes ever diverge. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["wgtrNewNode(name, type, ...)"] --> B["nmMalloc / memset / SETMAGIC"]
B --> C["strtcpy(node->Name, name, sizeof(node->Name))"]
C --> D["strtcpy(node->Type, type, sizeof(node->Type))\n✅ fixed (was sizeof(node->Name))"]
D --> E["snprintf(node->DName, ...)"]
E --> F["Set geometry & other fields"]
F --> G["Return pWgtrNode"]
Reviews (2): Last reviewed commit: "Fix a potential buffer overflow bug." | Re-trigger Greptile
|
PR cleared for human review. |
|
Redefining the scope on this since I've changed my methodology and no longer think trying to cluster unrelated fixes into a single PR is a good idea. |
|
Once again, this PR is still cleared for human review. |
Fix a potential buffer overflow in
wgtr.c.