Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Safe eval

  • Loading branch information...
commit 7be1dcafcf36f96aabb555ceb96bfcf3a4637ce6 1 parent 3789a09
Trent Mick trentm authored committed
Showing with 2 additions and 3 deletions.
  1. +2 −3 gyp-reader.js
5 gyp-reader.js
View
@@ -2,10 +2,9 @@
module.exports = gr
var spawn = require("child_process").spawn
-, pyprog = "import sys;"
+, pyprog = "import sys, ast, json;"
+ "c = open(sys.argv[1]).read();"
- + "d = eval(c);"
- + "import json;"
+ + "d = ast.literal_eval(c);"
+ "print json.dumps(d)"
, StringDecoder = require("string_decoder").StringDecoder
Please sign in to comment.
Something went wrong with that request. Please try again.