Date: Tue, 26 Jul 2022 13:15:39 GMT From: Ed Maste <emaste@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 5db2f88fa537 - stable/12 - vtfontcvt: improve hex font format validation Message-ID: <202207261315.26QDFddc016313@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5db2f88fa537b851eba1ec26ec4396854bed6f5b commit 5db2f88fa537b851eba1ec26ec4396854bed6f5b Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2022-07-19 15:20:10 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2022-07-26 13:15:27 +0000 vtfontcvt: improve hex font format validation Previously an EOF would result in sscanf returning -1 leading to a crash. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 119db52f4228fae161306ac29dc739638c132c26) --- usr.bin/vtfontcvt/vtfontcvt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/vtfontcvt/vtfontcvt.c b/usr.bin/vtfontcvt/vtfontcvt.c index 7553d66d99d2..40ff866e0c5f 100644 --- a/usr.bin/vtfontcvt/vtfontcvt.c +++ b/usr.bin/vtfontcvt/vtfontcvt.c @@ -450,7 +450,7 @@ parse_hex(FILE *fp, unsigned int map_idx) if (bytes != NULL) errx(1, "malformed input: Width tag after font data"); set_width(atoi(ln + 9)); - } else if (sscanf(ln, "%6x:", &curchar)) { + } else if (sscanf(ln, "%6x:", &curchar) == 1) { if (bytes == NULL) { bytes = xmalloc(wbytes * height); bytes_r = xmalloc(wbytes * height);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207261315.26QDFddc016313>