readline: Zero out the buffer before using it

This commit is contained in:
czapek1337 2022-01-28 23:55:52 +01:00
parent 2c1604089c
commit 53e515e642
1 changed files with 1 additions and 0 deletions

View File

@ -272,6 +272,7 @@ void readline(const char *orig_str, char *buf, size_t limit) {
term_autoflush = false;
size_t orig_str_len = strlen(orig_str);
memset(buf, 0, limit);
memmove(buf, orig_str, orig_str_len);
buf[orig_str_len] = 0;