:: commit 53e515e6421421a861968e0741bd14e6729cb58d

czapek1337 <czapek1337@gmail.com> — 2022-01-28 22:55

parents: 2c1604089c

readline: Zero out the buffer before using it

diff --git a/stage23/lib/readline.c b/stage23/lib/readline.c
index 06667405..28673ab3 100644
--- a/stage23/lib/readline.c
+++ b/stage23/lib/readline.c
@@ -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;
 
tab: 248 wrap: offon