From 03fe7da186ff239a3cebaca3f2ce1e1c4b7d243f Mon Sep 17 00:00:00 2001 From: Dmytro Shyrshov Date: Thu, 20 Feb 2020 22:07:40 +0200 Subject: [rubygems/rubygems] Allow spaces in file headers during octal check https://github.com/rubygems/rubygems/commit/e9e25731d8 --- lib/rubygems/package/tar_header.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/rubygems') diff --git a/lib/rubygems/package/tar_header.rb b/lib/rubygems/package/tar_header.rb index c37612772a..83a208bdf3 100644 --- a/lib/rubygems/package/tar_header.rb +++ b/lib/rubygems/package/tar_header.rb @@ -126,7 +126,8 @@ class Gem::Package::TarHeader end def self.strict_oct(str) - return str.oct if str =~ /\A[0-7]*\z/ + return str.strip.oct if str.strip =~ /\A[0-7]*\z/ + raise ArgumentError, "#{str.inspect} is not an octal string" end -- cgit v1.2.3