Commit c6e0416
committed
Fix heap buffer overflow when formatting an empty string
The `jv_string_empty` did not properly null-terminate the string data,
which could lead to a heap buffer overflow. The test case of
GHSA-p7rr-28xf-3m5w (`0[""*0]`) was fixed by the commit dc849e9,
but another case (`0[[]|implode]`) was still vulnerable. This commit
ensures string data is properly null-terminated, and fixes CVE-2025-48060.1 parent 3b00981 commit c6e0416
2 files changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1148 | 1148 | | |
1149 | 1149 | | |
1150 | 1150 | | |
| 1151 | + | |
1151 | 1152 | | |
1152 | 1153 | | |
1153 | 1154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2362 | 2362 | | |
2363 | 2363 | | |
2364 | 2364 | | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
2365 | 2369 | | |
2366 | 2370 | | |
2367 | 2371 | | |
| |||
0 commit comments