Replace unsafe Clojure reader with safe EDN reader
This commit is contained in:
parent
ed85046953
commit
6024a9cc31
2 changed files with 9 additions and 6 deletions
|
|
@ -3,9 +3,10 @@
|
|||
:url "https://github.com/ptaoussanis/nippy"
|
||||
:license {:name "Eclipse Public License"
|
||||
:url "http://www.eclipse.org/legal/epl-v10.html"}
|
||||
:dependencies [[org.clojure/clojure "1.4.0"]
|
||||
[expectations "1.4.49"]
|
||||
[org.iq80.snappy/snappy "0.3"]]
|
||||
:dependencies [[org.clojure/clojure "1.4.0"]
|
||||
[org.clojure/tools.reader "0.7.5"]
|
||||
[expectations "1.4.49"]
|
||||
[org.iq80.snappy/snappy "0.3"]]
|
||||
:profiles {:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
|
||||
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
|
||||
:1.6 {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@
|
|||
(:require [taoensso.nippy
|
||||
(utils :as utils)
|
||||
(compression :as compression :refer (snappy-compressor))
|
||||
(encryption :as encryption :refer (aes128-encryptor))])
|
||||
(encryption :as encryption :refer (aes128-encryptor))]
|
||||
[clojure.tools.reader
|
||||
(edn :as edn)])
|
||||
(:import [java.io DataInputStream DataOutputStream ByteArrayOutputStream
|
||||
ByteArrayInputStream]
|
||||
[clojure.lang Keyword BigInt Ratio PersistentQueue PersistentTreeMap
|
||||
|
|
@ -227,7 +229,7 @@
|
|||
(let [type-id (.readByte s)]
|
||||
(utils/case-eval type-id
|
||||
|
||||
id-reader (read-string (read-utf8 s))
|
||||
id-reader (edn/read-string (read-utf8 s))
|
||||
id-bytes (read-bytes s)
|
||||
id-nil nil
|
||||
id-boolean (.readBoolean s)
|
||||
|
|
@ -262,7 +264,7 @@
|
|||
(bigint (read-biginteger s)))
|
||||
|
||||
;;; DEPRECATED
|
||||
id-old-reader (read-string (.readUTF s))
|
||||
id-old-reader (edn/read-string (.readUTF s))
|
||||
id-old-string (.readUTF s)
|
||||
id-old-map (apply hash-map (utils/repeatedly-into []
|
||||
(* 2 (.readInt s)) (thaw-from-stream s)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue