Commit 3b56be7
Fix security audit issues and CI regressions
- Revert manual directory traversal checks in `untar_archive` which incorrectly broke valid relative extraction paths (tar-rs already handles slip traversal checks internally via `unpack`).
- Refactor SQLite connection passing: Replaced highly insecure raw `Box::into_raw`/`Box::from_raw` pointer casts mapping connection handles as script integers, which allowed malicious or buggy scripts to perform arbitrary memory manipulation or use-after-frees. Now safely maintained via a `thread_local` `RefCell<HashMap>` mapped by `AtomicI64` IDs.
- Ensure all native API memory allocation functions (`ts_alloc_struct`, `ts_alloc_model`, `ts_alloc_enum`) check for null before converting C pointers back into strings, avoiding possible null dereference panics.
- Address unwraps when handling escape characters during compilation to correctly propagate the error on EOF.
Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com>1 parent 05a3aff commit 3b56be7
2 files changed
Lines changed: 28 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
133 | 137 | | |
134 | 138 | | |
135 | 139 | | |
| |||
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
147 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
148 | 156 | | |
149 | 157 | | |
150 | 158 | | |
| |||
163 | 171 | | |
164 | 172 | | |
165 | 173 | | |
166 | | - | |
167 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
168 | 184 | | |
169 | 185 | | |
170 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
115 | | - | |
| 117 | + | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
| |||
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
138 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
| |||
0 commit comments