rpatricia 0.08 → 0.09

Sign up to get free protection for your applications and to get access to all the features.
data/Changes CHANGED
@@ -1,4 +1,7 @@
1
- 0.08 2011/0812
1
+ 0.09 2012/07/18
2
+ - fix bounds error leading to "invalid prefix" exceptions
3
+
4
+ 0.08 2011/08/12
2
5
  - IPv6 support: Patricia.new(:AF_INET6)
3
6
  - minor internal cleanups and speedups
4
7
 
@@ -170,12 +170,14 @@ ascii2prefix(char *string, prefix_t *prefix)
170
170
  slash = memchr(string, '/', len);
171
171
  if (slash) {
172
172
  bitlen = strtol(slash + 1, &end, 10);
173
- if (*end || (bitlen < 0) || ((slash - string) >= (int)sizeof(save)))
173
+ len = slash - string;
174
+
175
+ if (*end || (bitlen < 0) || len >= sizeof(save))
174
176
  return NULL;
175
177
 
176
178
  /* copy the string to save. Avoid destroying the string */
177
- memcpy(save, string, slash - string);
178
- save[slash - string] = '\0';
179
+ memcpy(save, string, len);
180
+ save[len] = '\0';
179
181
  string = save;
180
182
  } else {
181
183
  bitlen = -1;
data/rpatricia.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = %q{rpatricia}
6
- s.version = %q{0.08} # remember to update Changes if this is changed
6
+ s.version = %q{0.09} # remember to update Changes if this is changed
7
7
 
8
8
  s.homepage = "http://www.goto.info.waseda.ac.jp/~tatsuya/rpatricia/"
9
9
 
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpatricia
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 8
9
- version: "0.08"
8
+ - 9
9
+ version: "0.09"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tatsuya Mori
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-13 00:00:00 Z
18
+ date: 2012-07-31 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: |-
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  requirements: []
75
75
 
76
76
  rubyforge_project:
77
- rubygems_version: 1.8.5
77
+ rubygems_version: 1.8.24
78
78
  signing_key:
79
79
  specification_version: 3
80
80
  summary: module for fast IP address/prefix lookups