From nobody Thu Dec 01 14:24:33 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 4NNJHQ16cLz4jLD2; Thu, 1 Dec 2022 14:24:34 +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 4NNJHQ0bThz3rLm; Thu, 1 Dec 2022 14:24:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669904674; 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=WMforndWoFiP7LGsEB+IwZKdmWZ3xE/oZIzXDyyHLoc=; b=aFRpaoIWfhkQffcA2mDoVadaiPYV01TU2P/W+b5sRxbxrumsliwr8SCvnkdeBS8kSKB8fO UwM9fRjIyZZXjy8wqYJuAXM0bu2+SKjkZlJb9NCc94BjG121Edqna+V7ag/evTwX0E22cm mJSmrkaO7f7eY3RmXNokmNq9C3K+SUn6jrcRpUQ3bLJbkZK3GSqP2MN3k3dowLGPpg/FG5 JVCe/QZOVmCMRcE+jpaj/Lhi81yNm1JDJtEb5K7iSGrtR102toDVrjSpn26wtPMsy26ZYg 1fiRHLRvY/4pUutmjl1+vtfnnXhOE4jAIozzs0NBIF4kJRRLwHmcMpZI6hRGaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669904674; 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=WMforndWoFiP7LGsEB+IwZKdmWZ3xE/oZIzXDyyHLoc=; b=K+cJMZY208Z8WryigBnWHWXE1rApBEhTrKp202S7S6kcZoGRmhFN5i6sNKhs5/mtKofizx hK0aqqXs1s4oazZMxLskxc3TYhVXF3yTUU3XBvmccha4B9Un/Omj9EhJIPpsBdQIlHrLBQ wUK0fYIUdD3QhN/BNehbQBt6F5wpfqS3VfUSTfP1rWmc59bkzBV8NIoSYsFvpfGE6UY0mD 77cohgmVyE4dq1tEV6vbGCiwb059sekxa0O5+Svju4t2/88icB3ra1trsiBlv4Hv8W1Wa6 7CMzHz3a5H9TR/sd0Fvp8Fs6Tuhv+pJZNgVSatbk2GVP/O5oQWb/siuJjJMOVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669904674; a=rsa-sha256; cv=none; b=dCa+suEtKZiKw60YEHo71x/VCh6uUWg7OKFrYeG4DRQdrN08mHmismCrhgFaeyh0J4U6UW CkvtTW/R9mCDtHzRmcELWflG1iOggMCs8GU20lN3BuxYgzpTn7wg0NJ9Uefk+H2uMuMnie pnV8eSG4ua0HBUmYTB7MPQX9zB9gcLyPulBUgYaz/iTwXDRO0Y0kwxF4vqoOri035OptZr aJP1kLBEQzhdmFGE4VX66hGkbE1K173qZKUGDvQk2oZfKH+doB5Sqw8rb0PlNNFRqZXF9P Eh1D6qgs3k/RXiXgWMeN6sg4L4izJZsoOKoQJW4aVc+szMOR0tgnHCyO62RtKg== 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 4NNJHP6kJvzfv0; Thu, 1 Dec 2022 14:24:33 +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 2B1EOXCF078775; Thu, 1 Dec 2022 14:24:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B1EOXMG078774; Thu, 1 Dec 2022 14:24:33 GMT (envelope-from git) Date: Thu, 1 Dec 2022 14:24:33 GMT Message-Id: <202212011424.2B1EOXMG078774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: d24b27283290 - main - 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/main X-Git-Reftype: branch X-Git-Commit: d24b27283290e404dfa2bf38cd0769e92092e384 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d24b27283290e404dfa2bf38cd0769e92092e384 commit d24b27283290e404dfa2bf38cd0769e92092e384 Author: Cy Schubert AuthorDate: 2022-11-30 23:53:49 +0000 Commit: Cy Schubert CommitDate: 2022-12-01 14:24:12 +0000 heimdal: Add additional checks for bad kadmind input Check return codes for bad input. MFC after: 3 days --- 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