summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-18 06:11:31 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-18 06:11:31 +0000
commitca7431965b41da76a9d63024b325edc2d127e97e (patch)
treeddb121be6bdadab4d75bbdec15c391331464469b /pack.c
parent3e2fdaf1dd76dc39177dce7937897f4dc70e875d (diff)
downloadruby-ca7431965b41da76a9d63024b325edc2d127e97e.tar.gz
Increase capacity for skipping paddings
fix for r40342 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pack.c b/pack.c
index 0a37d8d18e..e6ea8a93db 100644
--- a/pack.c
+++ b/pack.c
@@ -1941,7 +1941,7 @@ pack_unpack(VALUE str, VALUE fmt)
case 'm':
{
- VALUE buf = infected_str_new(0, (send - s)*3/4, str);
+ VALUE buf = infected_str_new(0, (send - s + 2)*3/4, str); /* +2 is for skipping paddings */
char *ptr = RSTRING_PTR(buf);
int a = -1,b = -1,c = 0,d = 0;
static signed char b64_xtable[256];