Clojure

Three-arg ExceptionInfo constructor permits nil data

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.5
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Patch:
    Code and Test
  • Approval:
    Triaged

Description

The argument check in the two-arg clojure.lang.ExceptionInfo constructor isn't present in the three-arg constructor so it's possible to create an ExceptionInfo with arbitrary (or nil) data.

E.g.:

user=> (clojure-version)
"1.5.1"

user=> (ex-info "hi" nil)
IllegalArgumentException Additional data must be a persistent map: null  clojure.lang.ExceptionInfo.<init> (ExceptionInfo.java:26)

user=> (ex-info "hi" nil (Throwable.))
NullPointerException   clojure.lang.ExceptionInfo.toString (ExceptionInfo.java:40)

Patch: clj-1380-v3.patch

Screened by: Alex Miller

  1. clj-1380.diff
    27/Oct/14 5:30 AM
    3 kB
    Gordon Syme
  2. clj-1380-v2.patch
    05/Aug/15 5:51 PM
    3 kB
    Michael Blume
  3. clj-1380-v3.patch
    07/Aug/15 3:03 PM
    3 kB
    Gordon Syme

Activity

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: