Commit 32312192 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #3608 from clayton-shopify/fix-mirb-off-by-one

Fix an off-by-one causing a buffer overflow in mirb.
parents 045e78c8 8e2279d1
......@@ -442,7 +442,7 @@ main(int argc, char **argv)
char_index = 0;
while ((last_char = getchar()) != '\n') {
if (last_char == EOF) break;
if (char_index > sizeof(last_code_line)-2) {
if (char_index >= sizeof(last_code_line)-2) {
fputs("input string too long\n", stderr);
continue;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment