From nobody Mon Jan 20 14:29:10 2025 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 4YcCQG3bMVz5lPLh; Mon, 20 Jan 2025 14:29: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCQG2S5Wz3Bmm; Mon, 20 Jan 2025 14:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383350; 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=CZaxG+AOy3FgFYojRR2Icu2dvVGUA6g1+Hsb2YgnKm4=; b=Ml1Su8JZd49IgzL7sQtdTska+Fwhi2rlrh1Gv+yO3HUurm3ABM20Jmu7ieJPne2RhCX6rA 5Enq+k93yR750S6UKSwI2Fu5BPH4vyiw0nLCIUth8j49QhEq5BLr/yMrCpQotk2PLOHxFA Ck3FrM15Y6APy4mWzvgAVvzbwIeutVxMwtNjKHN2uvEREGl2OSE+sh1t18b3tEvqEYqLHd lUbFNHs1DqsaKIAOeZ998BeW676FYdTh+wUOYanfD94cM6ky/ecoHh95BcKuRN8jtpBSVx XgtrGVXypOhksEBwOcYKOJNYnIsSl7EZUY2eV/cUX7KlUziG5L7H7AX9LgM7Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383350; 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=CZaxG+AOy3FgFYojRR2Icu2dvVGUA6g1+Hsb2YgnKm4=; b=tIQUWdVLowF4/3j2sm20ZPbLVo84YV/BvHhlg6S8D13xSZQ3Uu2SZXw51NZhYFrYNIuKIo hFxxklrNnr3g9uSZlamoF4of4bMJVWj65Mr4zlywukFWoowiDxW0QFJX/tPH4IXtS/dKLa 23Hv4jDGnt/PUfr1JVzQqyh7mzeA/6jWnQ8QIn1FYqw2Lkq4uBZvXnSGFOR58nRyZWr4hI Q+t1JizV1DSasThP8zu8xDBkfSAxBpNyxSLs60IhT3nHZd5goqe3qfb44Bq4G3xYDjA7lk 1zZBHCU3XXiIL7txtODc7QdwVIfRPFpBEEf9SD4EDfRCMpKXgl5E1rOkouVxWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383350; a=rsa-sha256; cv=none; b=lmAZi7FGIyrduDHN0xPfYxeg2ralCTqaTd07Z525o1SOzi/dl/NrXMXxUOOvWl/I+gsXUC QdanFjf7TcAP+Iudq7Kgx2N6G4YbNlFFhr5V/ang1Et2LGYjU8qVQhDx5m0oYgQ7VVztVI Di7mYVlxVv6t50oJtajkHsoMQoejGKMBL5TZULRRWBwNpULtxCiIp9IgPXZ5YfXe2h9RQ/ cVm5um7+siNwVYvxKD2oAchthgarfH/I2zZvOAx51iCedSy0nthide2ivrIwt8VEslOczs sAXRNFsuf9KCy0iIDiz/wyqI3A7SAU4w+koYXp+HqnMYxF/YyBN7orCebYE7HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YcCQG1zNFz8Ls; Mon, 20 Jan 2025 14:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KETAHu088145; Mon, 20 Jan 2025 14:29:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KETAD3088142; Mon, 20 Jan 2025 14:29:10 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:29:10 GMT Message-Id: <202501201429.50KETAD3088142@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: 8ed2e663712c - stable/13 - libbsnmp: avoid division by zero with empty password 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 8ed2e663712c3749b10af7968a646b9e81b6bcea Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8ed2e663712c3749b10af7968a646b9e81b6bcea commit 8ed2e663712c3749b10af7968a646b9e81b6bcea Author: Gleb Smirnoff AuthorDate: 2025-01-11 05:08:02 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:28:54 +0000 libbsnmp: avoid division by zero with empty password PR: 283909 (cherry picked from commit 4dc1820a16b9b6108e0ff8a0265c08c67fa34146) (cherry picked from commit c4cae8cbc337eaf824774fcba88018e42fa31efa) --- contrib/bsnmp/lib/snmpclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c index 05711e341fd7..a7556527ad51 100644 --- a/contrib/bsnmp/lib/snmpclient.c +++ b/contrib/bsnmp/lib/snmpclient.c @@ -1792,7 +1792,7 @@ snmp_discover_engine(char *passwd) if (snmp_client.user.auth_proto == SNMP_AUTH_NOAUTH) return (0); - if (passwd == NULL || + if (passwd == NULL || strlen(passwd) == 0 || snmp_passwd_to_keys(&snmp_client.user, passwd) != SNMP_CODE_OK || snmp_get_local_keys(&snmp_client.user, snmp_client.engine.engine_id, snmp_client.engine.engine_len) != SNMP_CODE_OK)