29 lines
936 B
Diff
29 lines
936 B
Diff
From 1658c0150e4a3d87d1e36b7755de0079e2e6a133 Mon Sep 17 00:00:00 2001
|
|
From: Karel Zak <kzak@redhat.com>
|
|
Date: Mon, 29 Apr 2024 14:55:16 +0200
|
|
Subject: [PATCH] wall: make sure unsigned variable not underflow
|
|
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Reference:https://github.com/util-linux/util-linux/commit/1658c0150e4a3d87d1e36b7755de0079e2e6a133
|
|
Conflict:NA
|
|
---
|
|
term-utils/ttymsg.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/term-utils/ttymsg.c b/term-utils/ttymsg.c
|
|
index faa0344fe..ef7e35899 100644
|
|
--- a/term-utils/ttymsg.c
|
|
+++ b/term-utils/ttymsg.c
|
|
@@ -123,7 +123,7 @@ ttymsg(struct iovec *iov, size_t iovcnt, char *line, int tmout) {
|
|
iovcnt * sizeof(struct iovec));
|
|
iov = localiov;
|
|
}
|
|
- for (cnt = 0; wret >= (ssize_t) iov->iov_len; ++cnt) {
|
|
+ for (cnt = 0; wret >= (ssize_t) iov->iov_len && iovcnt > 0; ++cnt) {
|
|
wret -= iov->iov_len;
|
|
++iov;
|
|
--iovcnt;
|
|
--
|
|
2.33.0
|
|
|