From nobody Tue Jul 19 15:48:19 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LnNXM68WGz4TPhl; Tue, 19 Jul 2022 15:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LnNXM5Z90z3psQ; Tue, 19 Jul 2022 15:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658245699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Df6NOTYoZqHYAV/2ez/Ez8lS9oEimJ6F5uCLe0Qg2rc=; b=JuArRLMxxZgSS+izHNOCbBiPqqD56IyJubn68BJ7NbfITHO038pAWFhvYCKyIcg/HjYpAX SIQ7jClOxH/WSnMXaiZ+fB+Uo1J9oN0pvqsxTDzdKUmf1Ws+P1MTin8ryIlUHItS4igCAj yIHXB8AJok3Xj4MS4tYfeGqRrdtKULWu8itlUdTBmw7LLt++lELhD/48wVDFTFv5sSwScR zHgpDYwbVWRYK/GOOEnJI/mnx1bqcnnC1MLAeq87OILLNCZ6eDpxiDGTGM35cT4cAfZZJL j5+5FwxvWumWT3vbcPsBSpCH4QnyzwX5kPM42FWHELrUpaNXzfobEiCwzPYAKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LnNXM4bBKzPbB; Tue, 19 Jul 2022 15:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26JFmJp4087418; Tue, 19 Jul 2022 15:48:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26JFmJTN087417; Tue, 19 Jul 2022 15:48:19 GMT (envelope-from git) Date: Tue, 19 Jul 2022 15:48:19 GMT Message-Id: <202207191548.26JFmJTN087417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 119db52f4228 - main - vtfontcvt: improve hex font format validation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 119db52f4228fae161306ac29dc739638c132c26 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658245699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Df6NOTYoZqHYAV/2ez/Ez8lS9oEimJ6F5uCLe0Qg2rc=; b=dzHgnBZx4S7z3Dyat3Q3dyPGRORMMolgrdRdSZdNYJhhcFPMlx0qzA/jaAwOl+ltkRsyYT sEkwAcHyZSzWSOdrXCVSI0P1Cm9ug90ukUT6mX0am/GiXw//L0xxI36p44EII1jT/hwO7v RXCf+un95aVymHatKHtLZpMIcFe3tRF+0Fqfvjm5Y1gcMxkF+W8aw/yitSQqW4TnHAW4Hs g6Pd6uvCC4FjI1/5EBDo3bljn5ejxmDTUS7mu5L7FgX9So6Euz+SpCbYM8Y9ecjKINup5L 8TBmrq5GNeNIyrH10EeTlhs9xXxsO2MD2T2b/QdXfodvOeGhg14Wf4TF6NxL7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658245699; a=rsa-sha256; cv=none; b=jS0jbx02Lqjk/qK3NCOTPMKBUDgW8fYtsEqhXqUb1ycglrqG4/ZmvS5klYgqFcLNbyGJMg Nhc6ouXMvXhi8Ik4Yh5O44bC/1WaOK9Xust/ZF8f2YBkO+R98voSYR/BeZSpVHRKfV8FSX JJFnTyrFkBqz3xrEqKHEAo67LvwD3w3qnDlHuLio1x6EC9VTa+hF4pYZ4wgWsqw9IicaoW fjBYNUH0rs1Sts2+eKOeW0EZvr2kz2vddTeCWI5j4D4WyZ8hJsc0+HrPhYOL8AwQCw+gQA nP/lhLQg49VaXxxTTovrUq+eUnjqnQfctMsh5oCkzAW1igPNyXpvhk5k5s46FA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=119db52f4228fae161306ac29dc739638c132c26 commit 119db52f4228fae161306ac29dc739638c132c26 Author: Ed Maste AuthorDate: 2022-07-19 15:20:10 +0000 Commit: Ed Maste CommitDate: 2022-07-19 15:48:09 +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 --- 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 8effafcf16f2..eafe7209796f 100644 --- a/usr.bin/vtfontcvt/vtfontcvt.c +++ b/usr.bin/vtfontcvt/vtfontcvt.c @@ -565,7 +565,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);