Skip to content

Commit b170f02

Browse files
committed
merge revision(s) 4e0bb58: [Backport #21811]
[PATCH] fix underflow
1 parent cc4ce48 commit b170f02

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ pack_pack(rb_execution_context_t *ec, VALUE ary, VALUE fmt, VALUE buffer)
302302
else if (ISDIGIT(*p)) {
303303
errno = 0;
304304
len = STRTOUL(p, (char**)&p, 10);
305-
if (errno) {
305+
if (len < 0 || errno) {
306306
rb_raise(rb_eRangeError, "pack length too big");
307307
}
308308
}

0 commit comments

Comments
 (0)