From nobody Fri Jun 30 16:43:02 2023 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 4Qt1Ms35f7z4kS6D; Fri, 30 Jun 2023 16:43:05 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qt1Mr6H3Cz3Qk8; Fri, 30 Jun 2023 16:43:04 +0000 (UTC) (envelope-from mhorne@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688143384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gub6khM6wuucOCC/zryUY1GzeGTsRkDCe+PXfGqxOSY=; b=TZr+ukpmA61u9A8gYYoB3FOpuqJbQIZfxjqJ/jRB6dyl4fvcCGJD10Jy9RctVCn4YelKIC 7yj/7e5t3FJy1kcR01JjerOFC8ZEAFIll0ri/xrrwVbxQQ20HUWaPX/PMR8ZgFV/QiVNw+ mwzF8s5S1lcNRzZSgndcSGNPx7bpq6ZJpSqX8OIQL8Pkgw1rUwS9Qis1+h2V8rt2Kny7ou XRMoBNohW9aCAn1okq+WZuavu93atX3xKdnmc2yGCFth02+fFJcH4FtF1gk8yPNJPTT9/G UHBl1OBY1QGRdmGFX5bXvy/2Fr3jfmBUQpAZSFfroU0MC35qbcExtqVWUcT00Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688143384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gub6khM6wuucOCC/zryUY1GzeGTsRkDCe+PXfGqxOSY=; b=NQBxaa/fRPjCxgIaKhsU4WwyR1rSXJc+81tZBtA83LndpzgMir3IrYXdadwCg0n/YnwaQq wBIEqGKOzNLUkKTANBQXAtU82T9yMdgQ8SD/7Y3/hOd++KjjcHXgHaUf1KsxhmZtcX/l2G X2i7H/TkbZv/G676CTCB5jBUO/a+6zyObVnL3BV4KuFoyNiwO54Z47CvoyBUYTlzWAF35N 3XAw2QzkOxzCelc32rKIuYMbYQP1e+MstgFJBXZ/ZtVZ9GtNbMOb01DixhurZhma5VOPv2 q3uusBGDFOQKb0avzmzzasMkHu2EvkkT9gwK62OsyXHiSTX38A7WVz+IZAxz9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688143384; a=rsa-sha256; cv=none; b=hlWzHM7RrqmW5VayTPYausqKGYmTTGZqRlXlwhEQF35IE9TFn6+iN5Ens8XF9TFG/dDsE2 85XvoEblHZRtC28sLSl5Aj/J1b3UWg0xzDEFII+7FsMONKhGgDlKouZeLOf/aiXsVmeJJg qJAX3mKoKC6e3zgSqklRCPB0nNOoRdzQzuKNOXYklCiqT8AuXFMo6Ve51MUMIN1UE1Ykz5 MjYwH4LJquy0ZyeuP8buHsXc/tqHAaeRo0uZK7lKdlGn54ceCBQHKXAoa84zOHYgycMnPl iyBnXTJrNm1y3RIzW89maParm3AkTPZ3FjZe0FFkcFC/Zgv4C9qEliKFLtSLdg== Received: from [192.168.1.151] (host-173-212-76-127.public.eastlink.ca [173.212.76.127]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Qt1Mr3pfgzd5W; Fri, 30 Jun 2023 16:43:04 +0000 (UTC) (envelope-from mhorne@freebsd.org) Message-ID: <498f3ba2-dc7a-e7d3-626a-76ca68cee5b2@freebsd.org> Date: Fri, 30 Jun 2023 13:43:02 -0300 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 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: git: 56f3f2d2491e - main - libsecureboot: avoid set but not used errors Content-Language: en-CA To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202306300652.35U6qpgP027126@gitrepo.freebsd.org> <667C347E-B7C7-405B-AFEC-F0A0FD0656F6@freebsd.org> From: Mitchell Horne In-Reply-To: <667C347E-B7C7-405B-AFEC-F0A0FD0656F6@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 6/30/23 11:42, Jessica Clarke wrote: > On 30 Jun 2023, at 07:52, Simon J. Gerraty wrote: >> >> The branch main has been updated by sjg: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=56f3f2d2491e30f369f9461c3cb2a366bdffbe1d >> >> commit 56f3f2d2491e30f369f9461c3cb2a366bdffbe1d >> Author: Simon J. Gerraty >> AuthorDate: 2023-06-30 06:52:17 +0000 >> Commit: Simon J. Gerraty >> CommitDate: 2023-06-30 06:52:17 +0000 >> >> libsecureboot: avoid set but not used errors >> >> Reviewed by: stevek >> --- >> lib/libsecureboot/openpgp/opgp_sig.c | 22 ++++++++++++---------- >> lib/libsecureboot/vets.c | 7 +++++-- >> 2 files changed, 17 insertions(+), 12 deletions(-) >> >> diff --git a/lib/libsecureboot/openpgp/opgp_sig.c b/lib/libsecureboot/openpgp/opgp_sig.c >> index eec3469e3457..7f4e6fb98fd1 100644 >> --- a/lib/libsecureboot/openpgp/opgp_sig.c >> +++ b/lib/libsecureboot/openpgp/opgp_sig.c >> @@ -464,20 +464,22 @@ verify_asc(const char *sigfile, int flags) >> size_t n; >> unsigned char *fdata, *sdata; >> size_t fbytes, sbytes; >> - >> + >> + fdata = NULL; >> if ((sdata = read_file(sigfile, &sbytes))) { >> n = strlcpy(pbuf, sigfile, sizeof(pbuf)); >> - if ((cp = strrchr(pbuf, '.'))) >> - *cp = '\0'; >> - if ((fdata = read_file(pbuf, &fbytes))) { >> - if (openpgp_verify(pbuf, fdata, fbytes, sdata, >> - sbytes, flags)) { >> - free(fdata); >> - fdata = NULL; >> + if (n < sizeof(pbuf)) { >> + if ((cp = strrchr(pbuf, '.'))) >> + *cp = '\0'; >> + if ((fdata = read_file(pbuf, &fbytes))) { >> + if (openpgp_verify(pbuf, fdata, fbytes, sdata, >> + sbytes, flags)) { >> + free(fdata); >> + fdata = NULL; >> + } >> } >> } >> - } else >> - fdata = NULL; >> + } >> free(sdata); >> return (fdata); >> } >> diff --git a/lib/libsecureboot/vets.c b/lib/libsecureboot/vets.c >> index 4375dfa76a89..12191097ff8c 100644 >> --- a/lib/libsecureboot/vets.c >> +++ b/lib/libsecureboot/vets.c >> @@ -241,11 +241,14 @@ x509_cn_get(br_x509_certificate *xc, char *buf, size_t len) >> mc.vtable->start_cert(&mc.vtable, xc->data_len); >> mc.vtable->append(&mc.vtable, xc->data, xc->data_len); >> mc.vtable->end_cert(&mc.vtable); >> - /* we don' actually care about cert status - just its name */ >> + /* we don't actually care about cert status - just its name */ >> err = mc.vtable->end_chain(&mc.vtable); >> >> - if (!cn.status) >> + if (!cn.status) { >> buf = NULL; >> + if (err == 0) /* keep compiler happy */ >> + buf = NULL; > > This is nonsense code. > > Jess And yours is a needlessly abrasive and unhelpful reply. Seriously Jess, if your choice is to read through and nit-pick peoples' changes, then at least learn to deliver your feedback with an ounce of tact. Mitchell > >> + } >> return (buf); >> } >> >