Permalink
Browse files

Fix an off-by-one causing a buffer overflow in mirb.

  • Loading branch information...
clayton-shopify committed Apr 13, 2017
1 parent 045e78c commit 8e2279d1ff0a6a2ca4307c204b4da3dbb4505e70
Showing with 1 addition and 1 deletion.
  1. +1 −1 mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
@@ -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;
}

0 comments on commit 8e2279d

Please sign in to comment.