diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-28 10:37:07 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-28 10:37:07 +0000 |
commit | b9121fe7602a560c4fee9ab353a7f57a3988ec73 (patch) | |
tree | 86912fe643f32b882ce6c682c965494dd9dba3bc /pack.c | |
parent | 634232aab57007bbad5c4bad0147d5c965f01d25 (diff) |
merge revision(s) 62992:
pack.c: fix underflow
* pack.c (pack_unpack_internal): get rid of underflow.
https://hackerone.com/reports/298246
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r-- | pack.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1235,7 +1235,7 @@ pack_unpack(VALUE str, VALUE fmt) else if (ISDIGIT(*p)) { errno = 0; len = STRTOUL(p, (char**)&p, 10); - if (errno) { + if (len < 0 || errno) { rb_raise(rb_eRangeError, "pack length too big"); } } |