Skip to content

Commit 6b9b727

Browse files
committed
fix for possible out-of-bounds memory access in repl
1 parent 61af1dd commit 6b9b727

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

repl.c

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ static char *readline(const char *prompt) {
1919
}
2020

2121
size_t len = strlen(line);
22+
23+
if (len < 1)
24+
return NULL;
25+
2226
if (line[len - 1] == '\n') {
2327
line[len - 1] = '\0';
2428
len -= 1;

0 commit comments

Comments
 (0)