From nobody Sat Jan 11 05:33:37 2025 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 4YVRyT630vz5lJJR; Sat, 11 Jan 2025 05:33:37 +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 4YVRyT5MPHz4hxw; Sat, 11 Jan 2025 05:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736573617; 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=F5LWh2N2aeahon+DGuNpeeEojO6g5VcCgyOVhQyX6J4=; b=c8HwlFXYup8mGVxA9yoguPlVrFGYOlABttNBTJkF5OHjiEe7DeYQ0uCbqeSDD4TJTaQj16 6HeRqkBU+MdaEpa6GnGhzQEjrwGUxMS8z07YWIf/aW3uIXGEHgTbiXYYmG+B3UbwiYEWJR WAoxYdxloTU6fE2VFniIT+dbarcol0NaIuNrKcC0fjSw80dbxsC5n7xoGmi+GWi/wbCvRF O1VZU1PC8OoyZ1oal6EknNuGc9HtxJGyry0dvJkAs/eUzfHEr+kzeMsCMRTbV8uzB40VXK IFY6zBFUWIfC/NOKTy5quKAjEPKnJG8i1vl/vuD7JGl9e58sM9f+5EKDUayYNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736573617; 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=F5LWh2N2aeahon+DGuNpeeEojO6g5VcCgyOVhQyX6J4=; b=JujJRhz8iRzbq3Sd5XRmscXZ5+vQOi0iYpCyqW8/56KeBqpzBrw+PJR/wjzwHWkxcHBryS P6J4DWX6MWatlEELTs6Es70YFFTg3gLs5zSgOFFKoZZLafWM1LY8+NXqCk5NqrB3uqy7qz ZpWV+mIF/GwYbfaEjF8of2KtrXiTBOFn7o623jQ/mr3SpZ4RaVliDwqgaZM5yAyZ4U7nZ5 ks6XpvK5k3r/9L1U1NSu1gnmSkRrDBgl8qmsYVGWKxhgate54GJtLzGnsPCxNBd3Osw1wb kGjuD5Qi0YOrdpK7BcPKZFOuP0BA5GL5xdVaQ3uHbkR3rqb/ySD2YPkAzRV26Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736573617; a=rsa-sha256; cv=none; b=C5IWJtqidnC86mPQjxT1gOMMVjeENA9kKZUmbI0sBmPcctfZd3BDQ0quKHW1pjWPDs3FFs Ebd1dpTlFBBImGV24GN5IFoxWvtbeCdP8wfgZc5afC2Vm/mWXLjmIVte7tRwY7BG8EsMh2 /rpGJuKJkfzyaHIbuu2PdjhYbq8xJALvcATo7JeYYq6MlO7yb37U5feNSbNzOa/9VUCiDv kd3oNkaXEhkSSOVbuZMKKnwrI+Ysbku7DXVI6i7HVovM0NM88sXA1bg2oRoOvxoWUuE/sG N6EDuS/ErXFh4cpdgMuxO4V9rM7bcusVXpW8fBXrVo0fLZNFdYVrac2bKMnxEg== 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 4YVRyT4mcSzlTd; Sat, 11 Jan 2025 05:33:37 +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 50B5Xb2k086442; Sat, 11 Jan 2025 05:33:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B5Xblu086439; Sat, 11 Jan 2025 05:33:37 GMT (envelope-from git) Date: Sat, 11 Jan 2025 05:33:37 GMT Message-Id: <202501110533.50B5Xblu086439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 4dc1820a16b9 - main - libbsnmp: avoid division by zero with empty password 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4dc1820a16b9b6108e0ff8a0265c08c67fa34146 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=4dc1820a16b9b6108e0ff8a0265c08c67fa34146 commit 4dc1820a16b9b6108e0ff8a0265c08c67fa34146 Author: Gleb Smirnoff AuthorDate: 2025-01-11 05:08:02 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-11 05:08:02 +0000 libbsnmp: avoid division by zero with empty password PR: 283909 --- 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 ab3ac2d18e64..b312a37ed3ed 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)