<< Back to previous view

[DCODEC-5] Invalid input turns into null bytes Created: 16/Dec/16  Updated: 16/Dec/16

Status: Open
Project: clojure.data.codec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Critical
Reporter: Mike Kaplinskiy Assignee: Alexander Taggart
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Running something like:

(seq (clojure.data.codec.base64/decode (.getBytes "dl nd Znd;%;U=" "UTF-8")))
> (118 80 39 116 6 103 0 5)

Ideally clojure.data.codec throws or returns nil on bad input.






[DCODEC-4] Cannot roundtrip an empty array Created: 03/Nov/15  Updated: 21/Nov/15

Status: Open
Project: clojure.data.codec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Gary Fredericks Assignee: Alexander Taggart
Resolution: Unresolved Votes: 0
Labels: None
Environment:

0.1.0


Attachments: Text File DCODEC-4.patch    

 Description   

The following throws an ArrayIndexOutOfBoundsException:

(-> "" .getBytes b64/encode b64/decode)


 Comments   
Comment by Gary Fredericks [ 21/Nov/15 3:52 PM ]

Attached DCODEC-4.patch, which adds checks for empty input on the encode and decode functions, as well as a test.check spec that catches the bug.





[DCODEC-1] Add simple utility functions for base64 conversions? Created: 11/Nov/12  Updated: 29/Mar/14

Status: Open
Project: clojure.data.codec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Dave Sann Assignee: Alexander Taggart
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Can we add (something like) the following simple utility functions for base64 encoding/decoding ?

(defn bytes->b64str [bytes]
(String. (encode bytes)))

(defn str->b64str [s]
(bytes->b64str (.getBytes s)))

(defn b64str->bytes [b64-str]
(decode (.getBytes b64-str)))

(defn b64str->str [b64-str]
(String. (b64str->bytes b64-str)))



 Comments   
Comment by James Reeves [ 29/Mar/14 1:25 PM ]

Encoding strings might be a little edge-case, but I can certainly see a benefit to having encode-string and decode-string, or encode-str and decode-str.





[DCODEC-3] Hex (Base 16) codec Created: 15/Nov/14  Updated: 15/Nov/14

Status: Open
Project: clojure.data.codec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Daniel Compton Assignee: Alexander Taggart
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Is writing a data.codec.hex namespace for base 16 operations in scope of this project?






Generated at Fri Feb 24 15:43:28 CST 2017 using JIRA 4.4#649-r158309.