From nobody Mon Dec 05 21:50:48 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 4NQy0S6sNCz4jf6M; Mon, 5 Dec 2022 21:50:48 +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 4NQy0S4n4Rz3tDT; Mon, 5 Dec 2022 21:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670277048; 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=yJFOtPTx4kIBTi88Qtbc+e+GKjfREF3Aa77X9YtCz4c=; b=Pf0ltD2OPdO6qoP1lSQgnk52x2XjGAdvcQ53jm43mOESD5B5S1s80tUbhk9ea7GmYl9tNR wJZrkjHySlVKbcOwEIpkXH5BP6kvIWO9rH2RkvnuOd22wC1yKy7nv+NTkwh/Rl+VY34kRy sIOuzwt8gKzRdhQRSWWiwMbJ0w2t/UlKOOXB778ZASLtfoaFlEJ1jVPsfeMuJXUYcTRmFn jX4CftGoQy6++lNM7ikWGjU9ff5rJaw218AX2ymcl/EvoOTJQPMGYe4Y7JwwAcXTP/p4Sv qTm+6KyYS6fRKxhEJrnskkjK9cI8KKuFU3O4FnJ/VODkrYD5VDWY5G/o+Ly0wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670277048; 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=yJFOtPTx4kIBTi88Qtbc+e+GKjfREF3Aa77X9YtCz4c=; b=oVIiWOjJ/fwdph0IXjcrWZnF5tEzd9XVx389Wonoxe3i2xQvONzPAQMSbYt8JozAvFSaXR wChec4mTbvnA20FKt1bI26KwLKdL2yuWJ1K8MDmHo+B8GK3Jo443A/gRRYlV/rEKrsMMLT NHMV1n8dlHJTIqjg9g1DZbcJQZKiLf1hO2nayEJywUNIm6iYU2f5FE3OuqBTjQo4g2q/h/ XIkYsgWhp6/QSMr2Sa5zDX3nQHxbI/bTWXCMeJIhc5jAlm5osDAtZUguq1m2halSQrTtCE 9X1Z6ytMQ1pF2e0lMSAgEO6ZfnQNOjREK9PwKmrRPyyF0vBbKgFHKbQ/0Ps2qQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670277048; a=rsa-sha256; cv=none; b=QD8zaWYIUEfLFEiNvbbD1CfHzRY5xN0pqhNiSyAZW+sbMQx2L2YXtykp3MWWIZNjVI0AvX xLez4AY+xPde7o8nfzi5kwrRnvGMTIc9ktm56++v7iFGTRb4+XDEfr4ksXwDQzD5XvTLYy yEmdA/Bnhq1t82xK7CkcuEcpgV9qiUAXd6yCNNxIeIWNabZ5aMJpr0J4jUXJ1Rr4kVcc5T h2hkd9OJE/4hPrkAC24DcoT6qbwpOmfIreH03gs6zcsPkanmsCU+rmbwMaqILmFDaROO6c yWEAHzhGiuTk6h1cBc8UPO6pBtV5OHbTLMkysRhE+JwlY+gKi9PQMy7X1jXxAw== 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 4NQy0S3rg7z1CXh; Mon, 5 Dec 2022 21:50:48 +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 2B5Lom3i094305; Mon, 5 Dec 2022 21:50:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B5LombK094304; Mon, 5 Dec 2022 21:50:48 GMT (envelope-from git) Date: Mon, 5 Dec 2022 21:50:48 GMT Message-Id: <202212052150.2B5LombK094304@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: e7d6b2cd4304 - stable/12 - heimdal: Add additional checks for bad kadmind input 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: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e7d6b2cd43042d215bbca63355ea1981c4c93535 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=e7d6b2cd43042d215bbca63355ea1981c4c93535 commit e7d6b2cd43042d215bbca63355ea1981c4c93535 Author: Cy Schubert AuthorDate: 2022-11-30 23:53:49 +0000 Commit: Cy Schubert CommitDate: 2022-12-05 21:50:43 +0000 heimdal: Add additional checks for bad kadmind input Check return codes for bad input. (cherry picked from commit d24b27283290e404dfa2bf38cd0769e92092e384) --- crypto/heimdal/kadmin/server.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crypto/heimdal/kadmin/server.c b/crypto/heimdal/kadmin/server.c index ed6ba5a1f790..19dfd89d521a 100644 --- a/crypto/heimdal/kadmin/server.c +++ b/crypto/heimdal/kadmin/server.c @@ -428,9 +428,11 @@ kadmind_dispatch(void *kadm_handlep, krb5_boolean initial, krb5_store_int32(sp, ret); if(ret == 0){ int i; - krb5_store_int32(sp, n_princs); + if ((ret = krb5_store_int32(sp, n_princs))) + goto fail; for(i = 0; i < n_princs; i++) - krb5_store_string(sp, princs[i]); + if ((ret = krb5_store_string(sp, princs[i]))) + goto fail; kadm5_free_name_list(kadm_handlep, princs, &n_princs); } break; @@ -451,7 +453,7 @@ fail: krb5_store_int32(sp, ret); krb5_storage_to_data(sp, out); krb5_storage_free(sp); - return 0; + return ret; } static void