git: 74cbe4d7e55e - stable/13 - vmstat: fix overflow of interrupt name buffer
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 22 Jan 2023 09:19:25 UTC
The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=74cbe4d7e55e5fbdeb884aa44243178c6048af1f commit 74cbe4d7e55e5fbdeb884aa44243178c6048af1f Author: Elliott Mitchell <ehem+freebsd@m5p.com> AuthorDate: 2022-11-26 16:21:33 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2023-01-22 09:18:10 +0000 vmstat: fix overflow of interrupt name buffer (cherry picked from commit e5c30ac93055e708e26e075937263608b3eeb17d) --- usr.bin/vmstat/vmstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 9414855b2a68..b79fc8144d48 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1349,7 +1349,7 @@ dointr(unsigned int interval, int reps) /* Determine the length of the longest interrupt name */ intrname = intrnames; istrnamlen = strlen("interrupt"); - while(*intrname != '\0') { + while (intrname < intrnames + inamlen) { clen = strlen(intrname); if (clen > istrnamlen) istrnamlen = clen;