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"
|
:url "https://github.com/ptaoussanis/nippy"
|
||||||
:license {:name "Eclipse Public License"
|
:license {:name "Eclipse Public License"
|
||||||
:url "http://www.eclipse.org/legal/epl-v10.html"}
|
:url "http://www.eclipse.org/legal/epl-v10.html"}
|
||||||
:dependencies [[org.clojure/clojure "1.4.0"]
|
:dependencies [[org.clojure/clojure "1.4.0"]
|
||||||
[expectations "1.4.49"]
|
[org.clojure/tools.reader "0.7.5"]
|
||||||
[org.iq80.snappy/snappy "0.3"]]
|
[expectations "1.4.49"]
|
||||||
|
[org.iq80.snappy/snappy "0.3"]]
|
||||||
:profiles {:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
|
:profiles {:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
|
||||||
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
|
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
|
||||||
:1.6 {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]}
|
:1.6 {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@
|
||||||
(:require [taoensso.nippy
|
(:require [taoensso.nippy
|
||||||
(utils :as utils)
|
(utils :as utils)
|
||||||
(compression :as compression :refer (snappy-compressor))
|
(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
|
(:import [java.io DataInputStream DataOutputStream ByteArrayOutputStream
|
||||||
ByteArrayInputStream]
|
ByteArrayInputStream]
|
||||||
[clojure.lang Keyword BigInt Ratio PersistentQueue PersistentTreeMap
|
[clojure.lang Keyword BigInt Ratio PersistentQueue PersistentTreeMap
|
||||||
|
|
@ -227,7 +229,7 @@
|
||||||
(let [type-id (.readByte s)]
|
(let [type-id (.readByte s)]
|
||||||
(utils/case-eval type-id
|
(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-bytes (read-bytes s)
|
||||||
id-nil nil
|
id-nil nil
|
||||||
id-boolean (.readBoolean s)
|
id-boolean (.readBoolean s)
|
||||||
|
|
@ -262,7 +264,7 @@
|
||||||
(bigint (read-biginteger s)))
|
(bigint (read-biginteger s)))
|
||||||
|
|
||||||
;;; DEPRECATED
|
;;; DEPRECATED
|
||||||
id-old-reader (read-string (.readUTF s))
|
id-old-reader (edn/read-string (.readUTF s))
|
||||||
id-old-string (.readUTF s)
|
id-old-string (.readUTF s)
|
||||||
id-old-map (apply hash-map (utils/repeatedly-into []
|
id-old-map (apply hash-map (utils/repeatedly-into []
|
||||||
(* 2 (.readInt s)) (thaw-from-stream s)))
|
(* 2 (.readInt s)) (thaw-from-stream s)))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue