fix for possible out-of-bounds memory access in repl

This commit is contained in:
Lewis Van Winkle
2021-05-23 18:31:24 -05:00
parent 61af1dd24c
commit 6b9b7275e5

4
repl.c
View File

@@ -19,6 +19,10 @@ static char *readline(const char *prompt) {
}
size_t len = strlen(line);
if (len < 1)
return NULL;
if (line[len - 1] == '\n') {
line[len - 1] = '\0';
len -= 1;