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

Alex Miller made changes -
Field Original Value New Value
Priority Major [ 3 ] Minor [ 4 ]
Gordon Syme made changes -
Attachment clj-1380.patch [ 12875 ]
Alex Miller made changes -
Patch Code and Test [ 10002 ]
Gordon Syme made changes -
Attachment clj-1380.diff [ 13444 ]
Gordon Syme made changes -
Attachment clj-1380.patch [ 12875 ]
Andy Fingerhut made changes -
Labels checkargs
Alex Miller made changes -
Approval Triaged [ 10120 ]
Michael Blume made changes -
Attachment clj-1380-v2.patch [ 14943 ]
Gordon Syme made changes -
Attachment clj-1380-v3.patch [ 14950 ]
Alex Miller made changes -
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.:
{noformat}
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)
{noformat}
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.:
{noformat}
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)
{noformat}

*Patch:* clj-1380-v3.patch

*Screened by:* Alex Miller
Labels checkargs checkargs ft

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: