From nobody Tue Jul 26 13:15:10 2022 X-Original-To: dev-commits-src-all@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 4LscpQ2sNQz4X0nb; Tue, 26 Jul 2022 13:15:10 +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 4LscpQ2MRJz425J; Tue, 26 Jul 2022 13:15:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658841310; 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=Hm+cnMP3KJhhtZTlU7x2gdEKevKETwOnZmstl199wa8=; b=aUk9F0FiRitNyz9a3X9uphyOB1ehDQgpzSRwSvOZ3RrFW2/5x4Y3sKx2njjEg4tKnppA1U ceYWNvmgfN3uTn3DejydZ6hcv8Rnv+c3u2JLNpPxxPHrsEpLuedclxuCtd9fRmkz/f1fpT dNR+cVrSoT9aWXscVRzpqM9zcZewWWG1FD9MweX4PbuJpyzEbr2d6yJWogKS2ZOWUgeKJ9 PX6/AUl0EIPaxsJ4wJTDtmCdNNTcfD+baBwggw37mpdjTxfuLBnDViqVrzm/vPgTBFpPhX M1MHKTLkdk2U7EEq54+OMG/b7avlvD068zhQo0NrB5sluDcdPaWqgkdBziQ/MA== 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 4LscpQ1RW3zdZL; Tue, 26 Jul 2022 13:15:10 +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 26QDFA84016165; Tue, 26 Jul 2022 13:15:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26QDFANC016164; Tue, 26 Jul 2022 13:15:10 GMT (envelope-from git) Date: Tue, 26 Jul 2022 13:15:10 GMT Message-Id: <202207261315.26QDFANC016164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: bf57b550264c - stable/13 - vtfontcvt: improve hex font format validation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: bf57b550264c45e777acb8b5306076610bd072b6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658841310; 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=Hm+cnMP3KJhhtZTlU7x2gdEKevKETwOnZmstl199wa8=; b=qeOdb5/2IS0K72q6+VE1a3DBdw4OuflOT4ARLwLAHAUUbi9ruqH6duRyAIqkBE+HmQxRoB xX0Yf+R8xDoz6Oncad+QR94NIzqXddLDWE5eY3EPR6jtckushX/FamfnuaVDrGpROw4MLj 6V6EW/tPw7z04ENWDrrXzXPFhqRYT2+W7MflScb+K/4YVTsyYtQNv15bgceSjyu2PZKuDd nzfdh9YQkGpvdQiWGocro6oEilNsShwdiJHtXx0BP1mbAeGu7IkM/ePcRcbgoNsTxQMQO9 9zT7Yi6IBE6pGSTWqO4Nk6pRAVYH+dv1DxxTFYOQbFM9Nw46gX3jSrxLBIyXvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658841310; a=rsa-sha256; cv=none; b=Tv1tBE+xDFemhwppDNZADKY+hBbsLVRy6IoxkjQuKnxjFZzkWvTJEZopLkEtAe0rs0ZyGz dqQghqHCj9ofKoa0avTM5fbTRNiXKAizQx50onOaYZwDPnqSJauAblbWyDP+Iwi22hNp+t 6zvAoRoxhhH/WuNL7Z7xeG/6c+P9ci4GQMJI35oVAc8yqbnhrPvDHPP+aj+6DCg5p25V0m Qo5UwvjtPk7WnJ98S4ftxyWOnZlkYy6bhIPxiuV2w5TyzC6yDgtGH4UfMcTwF6+9c5yk9A thHsYu/kuw4sNJyIll42vOK4NEpwprBbrYhprewodoDwqHk0Z0eut4o/tJYLLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bf57b550264c45e777acb8b5306076610bd072b6 commit bf57b550264c45e777acb8b5306076610bd072b6 Author: Ed Maste AuthorDate: 2022-07-19 15:20:10 +0000 Commit: Ed Maste CommitDate: 2022-07-26 13:15:01 +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 ba580d863149..d73dd86414f4 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);