nokogiri 1.10.8-x86-mingw32 → 1.10.9-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 927596a4479504c91f69f29ac2a7221f292b3392de54d6c5391c03c32b7dda2e
4
- data.tar.gz: d14c2cb0bafe0256e3ce0ed2d7db08bdb547ee97abee801658c15009d7ba1993
3
+ metadata.gz: 89c143ecf266d4882c347f453102bd95ddb7f7676b261af761bdb254cc7052f8
4
+ data.tar.gz: 02d151441c81744b3da86d266e4d7db80840b4d267bc4e216861a961f5c0f798
5
5
  SHA512:
6
- metadata.gz: 0b1e8e9118937dd2d9c1f9f74cfe02cef50ee34d96079d0bc82c76db7568882203868e225dffa2ecd6bd262d7e6ccc2a76c08be58b04e25785fb3012da36bdcc
7
- data.tar.gz: 0b32797df0bbcaa9b327c649d60f477a7595d93e77e24289349430ce91d6c1fe69f772a921b77bf82c426f46edfa40476117c93b6ce306f310a4bae8c180bfbd
6
+ metadata.gz: 25e24181eb2e3e65c77ddfcbd1b971d6fd7bb3bd2b77d2b25f3344780a623b6556375f9b8fec580943f92d284aff43abcc91d79562e3f859020ad4669c2e339f
7
+ data.tar.gz: 801ab35ea3a973e7a2d1639416e83fbf8a1b1a391bd7df7967f4cff67417360fda49833bd849c558756f28e29e3c2a24ac8603a8c409929fb2c8277b4f0bf79e
@@ -133,6 +133,31 @@ static VALUE read_memory(VALUE klass, VALUE content)
133
133
  return rb_schema;
134
134
  }
135
135
 
136
+ /* Schema creation will remove and deallocate "blank" nodes.
137
+ * If those blank nodes have been exposed to Ruby, they could get freed
138
+ * out from under the VALUE pointer. This function checks to see if any of
139
+ * those nodes have been exposed to Ruby, and if so we should raise an exception.
140
+ */
141
+ static int has_blank_nodes_p(VALUE cache)
142
+ {
143
+ long i;
144
+
145
+ if (NIL_P(cache)) {
146
+ return 0;
147
+ }
148
+
149
+ for (i = 0; i < RARRAY_LEN(cache); i++) {
150
+ xmlNodePtr node;
151
+ VALUE element = rb_ary_entry(cache, i);
152
+ Data_Get_Struct(element, xmlNode, node);
153
+ if (xmlIsBlankNode(node)) {
154
+ return 1;
155
+ }
156
+ }
157
+
158
+ return 0;
159
+ }
160
+
136
161
  /*
137
162
  * call-seq:
138
163
  * from_document(doc)
@@ -152,6 +177,10 @@ static VALUE from_document(VALUE klass, VALUE document)
152
177
  /* In case someone passes us a node. ugh. */
153
178
  doc = doc->doc;
154
179
 
180
+ if (has_blank_nodes_p(DOC_NODE_CACHE(doc))) {
181
+ rb_raise(rb_eArgError, "Creating a schema from a document that has blank nodes exposed to Ruby is dangerous");
182
+ }
183
+
155
184
  ctx = xmlSchemaNewDocParserCtxt(doc);
156
185
 
157
186
  errors = rb_ary_new();
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  module Nokogiri
2
2
  # The version of Nokogiri you are using
3
- VERSION = "1.10.8"
3
+ VERSION = "1.10.9"
4
4
 
5
5
  class VersionInfo # :nodoc:
6
6
  def jruby?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.8
4
+ version: 1.10.9
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Aaron Patterson
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2020-02-10 00:00:00.000000000 Z
17
+ date: 2020-03-01 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: mini_portile2