mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fix an off-by-one causing a buffer overflow in mirb.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user