diff options
author | Jim Warner <james.warner@comcast.net> | 2022-06-26 00:00:00 -0500 |
---|---|---|
committer | Craig Small <csmall@dropbear.xyz> | 2022-07-03 21:33:07 +1000 |
commit | 1750dd2b96577ac2ca51666ca4ba1da38bcb60e9 (patch) | |
tree | bd9eced319d7126305acd3a650263f9f743c8ceb | |
parent | 73757f8bb9ce3ba48a552df9f228567190fece26 (diff) | |
download | procps-ng-1750dd2b96577ac2ca51666ca4ba1da38bcb60e9.tar.gz |
top: afford another level of protection for line input <=== port of newlib 757a3452
______________________________ original newlib message
This commit just provides the final protection against
possible screen corruption when processing line input.
[ such corruption was limited to the input line only ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
-rw-r--r-- | top/top.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1423,7 +1423,7 @@ static char *ioline (const char *prompt) { pos = strlen(buf); break; default: // what we REALLY wanted (maybe) - if (bufNXT < bufMAX && scrNXT < Screen_cols) { + if (bufNXT < bufMAX && scrNXT < Screen_cols && strlen(buf) < bufMAX) { int tot = UTF8_tab[(unsigned char)key], sav = pos; if (tot < 1) tot = 1; |