summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-28 11:44:55 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-28 11:44:55 +0000
commit70ad5986df7972d8f7cc5240990f2c348ae30842 (patch)
tree38aaf6fb6ed8491b5a7bbb48e3e440709e5f0f90 /pack.c
parent0977c1fa2a829308b2ee7b4a110634c39adc19c8 (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_4@63001 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 33bcb2b7d7..577deb5a82 100644
--- a/pack.c
+++ b/pack.c
@@ -1138,7 +1138,7 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
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");
}
}