time-util: fix buffer-over-run

Fixes #23928.
This commit is contained in:
Yu Watanabe
2022-07-08 16:09:46 +02:00
committed by Lennart Poettering
parent ef8304de53
commit 9102c625a6
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -591,7 +591,7 @@ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) {
t = b;
}
n = MIN((size_t) k, l);
n = MIN((size_t) k, l-1);
l -= n;
p += n;