Commit 224355e
Your Name
fix(mcp): use strcpy for semantic result strings to prevent use-after-free
The semantic_results section used yyjson_mut_obj_add_str (borrows pointer)
then called cbm_node_free_fields which freed those strings. The yyjson doc
then held dangling pointers, producing garbage in the JSON output.
Fix: use yyjson_mut_obj_add_strcpy (copies string) for all node fields
in the vector-only result loop.1 parent b380ee7 commit 224355e
1 file changed
+8
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1140 | 1140 | | |
1141 | 1141 | | |
1142 | 1142 | | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
1151 | 1151 | | |
1152 | 1152 | | |
1153 | 1153 | | |
| |||
0 commit comments