From nobody Tue Jul 26 13:15:39 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 4Lscpz2f82z4X0p8; Tue, 26 Jul 2022 13:15:39 +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 4Lscpz1sLTz42SK; Tue, 26 Jul 2022 13:15:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658841339; 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=g8gT6+l+dv/ATh10+ZSXU2S7ttLFZgPT0/EnUgaJi5Q=; b=HY4J8KC+/4BlymT0v2YSXL8H8Md0WDQ8lsHKUbzfzC3YoFHj8IEDJhmdQw7AtvgvDu/jwW xVp14c5RrjcgZtZRfSYFVZBpqH0TbonvcW+BHATm9Cvnj2csoKiXrw+t9K33dtR4uS9dnt M1qDCXNJ5Qu0fQpSlu4rVWv+Gi40XRdxVaUbazVm1M0wnnyX6gGJIZjhxJMlWu51r2L/GG srXd9WhgOkFmv/tbS/oh/uIkweb0vFrI+LhyBMLsY3vUkZG5HkaC1rIsNggR3AClWhkaGY a2edkZApsUmF1oNNvl0OTU3PG2kBX85PzyFsYYLNGWEMInjM5DMOmNEcy52GNw== 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 4Lscpz0sjZzdRH; Tue, 26 Jul 2022 13:15:39 +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 26QDFdxu016314; Tue, 26 Jul 2022 13:15:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26QDFddc016313; Tue, 26 Jul 2022 13:15:39 GMT (envelope-from git) Date: Tue, 26 Jul 2022 13:15:39 GMT Message-Id: <202207261315.26QDFddc016313@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: 5db2f88fa537 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 5db2f88fa537b851eba1ec26ec4396854bed6f5b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658841339; 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=g8gT6+l+dv/ATh10+ZSXU2S7ttLFZgPT0/EnUgaJi5Q=; b=qOjZgU3x4i3neaC1KkdRHgZ/V7jXKR+MBSctQ+0worPN+/O+AEVpcJ1+ooTnNXQeiYl2oN 5N7z9FG1Qr7Vq37+7+jyZB25dY7x/Tt7Oe21X31Z9CBOwlfHoMpcdCOKgYonhx/Psz7+oo AntBFe1Fv3423d5FcHjscy+9djl9CSrIAjrHCX+ihQ4qHUCgDE7n9Rqh5mZmBY90Wydnos JCWiT1+wS3xxDxzI9c2nky1jIRR52HS3KnOUZtiLCCPtfeJ3Is3LMbeCJj9D7Xyb/wG4rb /OkvqP9Q3GBaTTAA91VpPl00fku+GlvmCPU9ofdOMhTdc5yKPg/t+o0tpfld8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658841339; a=rsa-sha256; cv=none; b=lI0SkKxqN1XrNi2oZ0MVXv3hsV2TqfS1lazLy/HRcjdBHZ81emYmVgnOqeplCl+pTA0Sb4 rRb7I+HRRUPbTcxhHjncijdIc8+WB+gLI3t3IOt5yoFsXAxQrnmIH6snUJ20c6obhCFRox ztP1axFFc/p3kMQFExQunbhSjiOJDc9PojwAXDHf9Vi0GO5GZKquFJiLzpKZ8R8THTdGUf aFuwZ3umFMuYD+WtYxFEgrBDcajCzvlQezcXUYENRkbV7NmyfreTeFl7pE5d2Rzh21F8Ar dpo48GQnOTwLDNTnEQdMGYTTyAptybr5QJKJTdwQfL4LNha+hH9J/myVzbmHSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5db2f88fa537b851eba1ec26ec4396854bed6f5b commit 5db2f88fa537b851eba1ec26ec4396854bed6f5b Author: Ed Maste AuthorDate: 2022-07-19 15:20:10 +0000 Commit: Ed Maste 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);