Ascii85 2.0.1 → 2.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32c27ed5387adae778bb5f1b5ef82da6ca878d6cd3128dd9a6d65c182ad89296
4
- data.tar.gz: 81ba054e37db894fcb7411c143c6cfade2437bc91fd00956eeaf16233e96c25e
3
+ metadata.gz: 6866b24599936a3644853d934a6df51cd4c010e6ae2dd74bd1e0136b930a20bb
4
+ data.tar.gz: d2a7ca24ff02f36e287b9171df96c4f0d31f2377b312185fe4ea637dcb23ea3c
5
5
  SHA512:
6
- metadata.gz: da7757b98444ed6e745c0c9aa7930aa20346a273f94d316cb6eae473a6be293fd592320718f3d1eaef0ebc7d877deb4cb8ec0a43b13f4595835f56053abf3e5d
7
- data.tar.gz: e881585d8b1f1cbdba501e7891daa2ed19b268c0b67d0cc8e424d944ce84d16c685b563bc18f34cd92db45b9a8e306e99e7b62b6d41908443eecdc15ee8bcf30
6
+ metadata.gz: 88c6434f72cd175bc15d258bcf21e863fc2fcfdc05cd5cecbffeb2d4a6265734be9e327bd0d64d1c3e4ce0a83fffab396df55c33f2f8f80e7ad9ba7c5301502c
7
+ data.tar.gz: 7834017172e9aefc7ade9d9bcc4b3ba90cc4f4a2472a7cdeea31ce95ade21166adbb1e9e54c78e1bb587386404952c3c61118e0b35b9cd670fac612a72c472c5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Ascii85 Changelog
2
2
 
3
+ ## [2.0.2] - 2026-11-21
4
+
5
+ ### Fixed
6
+
7
+ - Decoding a partial, trailing 5-tuple to a value >= 2**32 raised `RangeError` instead of `DecodingError` (Issue #9)
8
+
3
9
  ## [2.0.1] - 2024-09-15
4
10
 
5
11
  ### Fixed
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ascii85
4
- VERSION = '2.0.1'
4
+ VERSION = '2.0.2'
5
5
  end
data/lib/ascii85.rb CHANGED
@@ -303,6 +303,8 @@ module Ascii85
303
303
  count -= 1
304
304
  word += lut[count]
305
305
 
306
+ raise(Ascii85::DecodingError, "Invalid Ascii85 5-tuple (#{word} >= 2**32)") if word > 0xffffffff
307
+
306
308
  bufwriter.write((word >> 24).chr) if count >= 1
307
309
  bufwriter.write(((word >> 16) & 0xff).chr) if count >= 2
308
310
  bufwriter.write(((word >> 8) & 0xff).chr) if count == 3
@@ -211,6 +211,12 @@ describe Ascii85 do
211
211
  assert_raises(Ascii85::DecodingError) { Ascii85.decode('<~s8W-#~>') }
212
212
  end
213
213
 
214
+ it 'should raise DecodingError if the last, partial tuple is >= 2**32' do
215
+ assert_raises(Ascii85::DecodingError) { Ascii85.decode('<~s8W-~>') }
216
+ assert_raises(Ascii85::DecodingError) { Ascii85.decode('<~!!!!!uu~>') }
217
+ assert_equal "\xFF\xFF\xFF".b, Ascii85.decode('<~s8W*~>')
218
+ end
219
+
214
220
  it 'should raise DecodingError if it encounters an invalid character' do
215
221
  assert_raises(Ascii85::DecodingError) { Ascii85.decode('<~!!y!!~>') }
216
222
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Ascii85
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Holzfuß
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-09-15 00:00:00.000000000 Z
10
+ date: 1980-01-01 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: minitest
@@ -51,8 +50,8 @@ executables:
51
50
  - ascii85
52
51
  extensions: []
53
52
  extra_rdoc_files:
54
- - README.md
55
53
  - LICENSE
54
+ - README.md
56
55
  files:
57
56
  - Ascii85.gemspec
58
57
  - CHANGELOG.md
@@ -69,7 +68,6 @@ homepage: https://github.com/DataWraith/ascii85gem/
69
68
  licenses:
70
69
  - MIT
71
70
  metadata: {}
72
- post_install_message:
73
71
  rdoc_options: []
74
72
  require_paths:
75
73
  - lib
@@ -84,8 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
82
  - !ruby/object:Gem::Version
85
83
  version: '0'
86
84
  requirements: []
87
- rubygems_version: 3.5.15
88
- signing_key:
85
+ rubygems_version: 3.7.2
89
86
  specification_version: 4
90
87
  summary: Ascii85 encoder/decoder
91
88
  test_files: