The GitHub Actions job "Build Burr" on burr.git/fix/safe-expr-bounds has 
succeeded.
Run started by GitHub user elijahbenizzy (triggered by elijahbenizzy).

Head commit for run:
8b4b413e0c5fa8d80bf736a2372cc9d7230290e5 / Elijah Ben Izzy 
<[email protected]>
fix(core): reject oversized safe_expr sources before parsing

The node-count bound runs on the parsed tree, but on Python 3.11 the parser
itself gives up on a 3000-term chain with RecursionError before that check
is reached. Two complementary bounds, both applied before/around ast.parse:

- the expression string may be at most 10_000 characters
  (_SAFE_EXPR_MAX_SOURCE_CHARS)
- RecursionError / MemoryError raised by ast.parse are re-raised as
  ValueError('safe_expr: expression is too deeply nested'); SyntaxError
  is unchanged

Tests: the deep-chain node-count case now uses 600 terms (parses on every
supported Python), the 3000-term chain is asserted to raise ValueError
regardless of which bound trips first, and a 20_000-character expression
is rejected on length. Docstring updated.

Report URL: https://github.com/apache/burr/actions/runs/37232794899

With regards,
GitHub Actions via GitBox

Reply via email to