hpricot 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ = 0.8.4
2
+ === 28 February, 2011
3
+ * GH #21, #32, #33, #36: Fix for reported segfaults
4
+
1
5
  = 0.8.3
2
6
  === 3 November, 2010
3
7
  * GH#8: Nil-check before downcasing attribute key
@@ -6811,8 +6811,14 @@ void hstruct_mark(void* ptr) {
6811
6811
  struct hpricot_struct* st = (struct hpricot_struct*)ptr;
6812
6812
  int i;
6813
6813
 
6814
- for(i = 0; i < st->len; i++) {
6815
- rb_gc_mark(st->ptr[i]);
6814
+ /* it's likely to hit GC when allocating st->ptr.
6815
+ * that should be checked to avoid segfault.
6816
+ * and simply ignore it.
6817
+ */
6818
+ if (st->ptr) {
6819
+ for(i = 0; i < st->len; i++) {
6820
+ rb_gc_mark(st->ptr[i]);
6821
+ }
6816
6822
  }
6817
6823
  }
6818
6824
 
@@ -668,8 +668,14 @@ void hstruct_mark(void* ptr) {
668
668
  struct hpricot_struct* st = (struct hpricot_struct*)ptr;
669
669
  int i;
670
670
 
671
- for(i = 0; i < st->len; i++) {
672
- rb_gc_mark(st->ptr[i]);
671
+ /* it's likely to hit GC when allocating st->ptr.
672
+ * that should be checked to avoid segfault.
673
+ * and simply ignore it.
674
+ */
675
+ if (st->ptr) {
676
+ for(i = 0; i < st->len; i++) {
677
+ rb_gc_mark(st->ptr[i]);
678
+ }
673
679
  }
674
680
  }
675
681
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hpricot
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 3
10
- version: 0.8.3
9
+ - 4
10
+ version: 0.8.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - why the lucky stiff
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-03 00:00:00 -05:00
18
+ date: 2011-02-28 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies: []
21
21