Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jul 2021 09:47:07 GMT
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 5694f4af7916 - stable/13 - kdump: use VIS_NOLOCALE when printing output
Message-ID:  <202107050947.1659l7v1071556@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by arichardson:

URL: https://cgit.FreeBSD.org/src/commit/?id=5694f4af7916110bc2f71bb150ecad863a46379d

commit 5694f4af7916110bc2f71bb150ecad863a46379d
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2021-06-16 15:28:27 +0000
Commit:     Alex Richardson <arichardson@FreeBSD.org>
CommitDate: 2021-07-05 09:46:11 +0000

    kdump: use VIS_NOLOCALE when printing output
    
    Attempting to parse the output as UTF-8 exposed an out-of-bounds read
    in vis(3) (see https://reviews.freebsd.org/D30771). However, I don't
    think it makes much sense to decode this output at all. Additionally,
    passing one byte at a time will almost certainly result in incorrect
    output for multi-byte characters.
    
    Reviewed By:    brooks
    MFC after:      3 days
    Differential Revision: https://reviews.freebsd.org/D30772
    
    (cherry picked from commit 1a3a57d74590bb44e96629aec35897b475bd69fa)
---
 usr.bin/kdump/kdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index 05988f43133e..d863fffea774 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -1638,7 +1638,7 @@ visdump(char *dp, int datalen, int screenwidth)
 	printf("       \"");
 	col = 8;
 	for (;datalen > 0; datalen--, dp++) {
-		 vis(visbuf, *dp, VIS_CSTYLE, *(dp+1));
+		vis(visbuf, *dp, VIS_CSTYLE | VIS_NOLOCALE, *(dp+1));
 		cp = visbuf;
 		/*
 		 * Keep track of printables and



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107050947.1659l7v1071556>