-
-
Notifications
You must be signed in to change notification settings - Fork 284
Open
Labels
Description
Buffer overflow detected when processing JSON files with ACIS data arrays.
Error
Reading JSON file example_r14.json
*** buffer overflow detected ***: terminated
Location
src/in_json.c
function json_acis_data
- incorrect buffer allocation calculation.
Details
The function allocates based on JSON array token size (t->end - t->start
) rather than the actual combined string content size, causing overflow when concatenating strings.
Reproduction
Build on Fedora with default flags (includes -D_FORTIFY_SOURCE=2
) and run:
dwgread -o example_r14.json test/test-data/example_r14.dwg
dwgwrite -o test.dwg example_r14.json
Evidence
CI failure: https://github.com/neilberkman/libredwg/actions/runs/17504170044/job/49724000228#step:10:170
Discovered while implementing multi-platform CI (#1181).