evalhook 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.1.3 Added check of null pointer of node->nd_entry when process individual gasgn node
2
+
3
+ 0.1.2 Added SecurityError when xstr nodes are found to avoid system calls
4
+
1
5
  0.1.1 Fixed ruby injection flaw in evalhook trick
2
6
 
3
7
  0.1.0 Created RDOC
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/gempackagetask'
6
6
 
7
7
  spec = Gem::Specification.new do |s|
8
8
  s.name = 'evalhook'
9
- s.version = '0.1.2'
9
+ s.version = '0.1.3'
10
10
  s.author = 'Dario Seminara'
11
11
  s.email = 'robertodarioseminara@gmail.com'
12
12
  s.platform = Gem::Platform::RUBY
@@ -112,14 +112,21 @@ void process_individual_node(NODE* node, VALUE handler) {
112
112
  case NODE_CVASGN:
113
113
  case NODE_CVDECL:*/
114
114
  case NODE_GASGN: {
115
- NODE* args1 = NEW_LIST(NEW_LIT(ID2SYM(node->nd_entry->id)));
116
- NODE* args2 = NEW_LIST(node->nd_value);
117
115
 
118
- node->nd_recv = NEW_CALL(NEW_LIT(handler), rb_intern("hooked_gasgn"), args1);
119
- node->nd_mid = rb_intern("set_value");
120
- node->nd_args = args2;
116
+ NODE* args1;
117
+ NODE* args2 = NEW_LIST(node->nd_value);
121
118
 
122
- nd_set_type(node, NODE_CALL);
119
+ if (node->nd_entry != 0) {
120
+ args1 = NEW_LIST(NEW_LIT(ID2SYM(node->nd_entry->id)));
121
+ } else {
122
+ args1 = NEW_LIST(NEW_LIT(ID2SYM(rb_intern("unknown_global"))));
123
+ }
124
+
125
+ node->nd_recv = NEW_CALL(NEW_LIT(handler), rb_intern("hooked_gasgn"), args1);
126
+ node->nd_mid = rb_intern("set_value");
127
+ node->nd_args = args2;
128
+
129
+ nd_set_type(node, NODE_CALL);
123
130
  break;
124
131
  }
125
132
  case NODE_CDECL: {
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evalhook
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dario Seminara
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-27 00:00:00 -03:00
18
+ date: 2010-12-28 00:00:00 -03:00
19
19
  default_executable:
20
20
  dependencies: []
21
21