tools.reader

Stack overflow on whitespace in reader/read and edn/read

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

reader/read and edn/read call themselves recursively for several encountered character classes - whitespace, comments.
This is high-risk for stack overflow, especially for machine-generated data.

Motivating Use Case: cljs files generated via cljx are particularly prone to trigger tools.reader stack overflow errors. Cljx replaces un-included forms with homomorphic whitespace blocks to preserve line number and column errors on compilation.

Activity

Hide
Nicola Mometto added a comment -

Fixed: https://github.com/clojure/tools.reader/commit/01b53cb61b586e78cf3f70f12ba2adbbdb7abb25

Thanks, I took the liberty of changing the commit description.

Show
Nicola Mometto added a comment - Fixed: https://github.com/clojure/tools.reader/commit/01b53cb61b586e78cf3f70f12ba2adbbdb7abb25 Thanks, I took the liberty of changing the commit description.
Nicola Mometto made changes -
Field Original Value New Value
Resolution Completed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]
Hide
Paul Michael Bauer added a comment -

Thanks for changing the commit message. facepalm
Missed that when I generated the patch

Show
Paul Michael Bauer added a comment - Thanks for changing the commit message. facepalm Missed that when I generated the patch

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: