cad-editor/src/app
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hakan Seven 87232bba2c fix(expr-eval): bound eval_to_string against super-linear DoS
The recursion-depth guard fixes the parser stack overflow, but user input
actually flows through eval_to_string (command line, viewport, dynamic
input — synchronous on the UI thread). Its embedded-expression fallback
re-tokenises every (start, end) window, so cost is ≈O(n³): a few-KB paste
of non-evaluable text or deeply nested parens froze the app for seconds to
minutes even though eval_number fast-returns None in microseconds
(measured: "x"×3200 → 16 s, 4 KB of parens → 51 s).

Cap the fallback scan at MAX_EVAL_SCAN_LEN (256) — whole-string numbers
and expressions of any length still evaluate via the fast paths; only the
mixed free-text scan is bounded, returning long input unchanged. Clarify
that MAX_RECURSION counts parser frames (256 ≈ 41 nested parens, not 256
levels). Add regression tests: the 41/42 nesting boundary, unary-chain and
function-arg-nesting rejection, and an eval_to_string over-cap promptness
test (50k junk + 100k nested parens return instantly).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 22:41:02 +03:00
..
commands feat(commands): integrate standard CAD commands and fix behavior gaps 2026-06-28 19:27:35 +03:00
update feat(io): default DWG save to 2018; bump acadrust handle-counter fix 2026-06-28 20:31:30 +03:00
view fix(shortcuts): honor Cmd as the accelerator modifier on macOS (#202) (#206) 2026-06-27 19:33:08 +03:00
automation.rs fix(rotate): apply a typed angle right after the centre (#159) 2026-06-25 19:58:45 +03:00
command_driver.rs fix(selection): clear selection when an interactive command ends 2026-06-28 10:28:23 +03:00
document.rs feat(ucs): interactive UCS icon with origin-snap grips, world-fixed compass 2026-06-27 01:12:45 +03:00
expr_eval.rs fix(expr-eval): bound eval_to_string against super-linear DoS 2026-06-28 22:41:02 +03:00
helpers.rs fix(paste): UTM-precise paste/block base via f64 centroid 2026-06-24 10:42:58 +03:00
history.rs perf(hash): swap std HashMap/HashSet for rustc-hash FxHash 2026-06-05 00:35:53 +03:00
layers.rs refactor: move resource/IO root modules under io/ 2026-06-26 23:06:40 +03:00
mod.rs feat(viewport): RMB 1st=Enter, 2nd=menu (no setting) 2026-06-27 16:32:40 +03:00
model_ops.rs refactor(scene): rename model_solid to solid_model 2026-06-16 11:39:31 +03:00
mtext_editor.rs refactor: remove remaining world_offset vestiges in app/ 2026-06-24 19:01:25 +03:00
plugin_host.rs fix(plugin): f64 pick coords + harden out-of-process lifecycle 2026-06-25 00:16:08 +03:00
properties.rs refactor: move resource/IO root modules under io/ 2026-06-26 23:06:40 +03:00
settings.rs feat(viewport): RMB 1st=Enter, 2nd=menu (no setting) 2026-06-27 16:32:40 +03:00
style_ops.rs chore: clear compiler warnings 2026-06-18 21:18:09 +03:00
text_inline.rs feat(ucs): orient text-bearing annotations to the active UCS 2026-06-22 18:18:35 +03:00
visibility.rs refactor(scene): group modules into role-based subfolders 2026-06-16 11:33:46 +03:00