data.json

read-escaped-char doesn't handle EOF correctly

Details

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

Description

The function read-escaped-char doesn't check the int read from stream for negative values meaning end-of-file. So if you call:

(json/read-str "\"\\")

it returns

IllegalArgumentException No matching clause: -1  clojure.data.json/read-escaped-char (json.clj:122)

Activity

Hide
Alexander Kiel added a comment -
Show
Alexander Kiel added a comment - Quick view of patch on github: https://github.com/alexanderkiel/data.json/compare/djson-14
Hide
Stuart Sierra added a comment -

Patch was not in proper `git am` format. Fixed anyway on Git `master`.

Show
Stuart Sierra added a comment - Patch was not in proper `git am` format. Fixed anyway on Git `master`.
Hide
Stuart Sierra added a comment -

Marking old issues as 'closed'

Show
Stuart Sierra added a comment - Marking old issues as 'closed'

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: