lvm2/0006-bugfix-fix-the-code-maybe-lead-to-buffer-over-bound-access.patch

14 lines
342 B
Diff
Raw Normal View History

2020-07-16 14:44:15 +08:00
diff --git a/tools/command.c b/tools/command.c
index 50791b1..3270b26 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -1375,7 +1375,7 @@ static int _copy_line(char *line, int max_line, int *position)
memset(line, 0, max_line);
- while (1) {
+ while ( p < strlen(_command_input) ) {
line[i] = _command_input[p];
i++;
p++;