From owner-dev-commits-src-branches@freebsd.org Mon Sep 13 14:52:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 022FF67CD87; Mon, 13 Sep 2021 14:52:56 +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 4H7Tx36f3rz3vSk; Mon, 13 Sep 2021 14:52:55 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C4446128D; Mon, 13 Sep 2021 14:52:55 +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 18DEqtX1057854; Mon, 13 Sep 2021 14:52:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DEqtlS057853; Mon, 13 Sep 2021 14:52:55 GMT (envelope-from git) Date: Mon, 13 Sep 2021 14:52:55 GMT Message-Id: <202109131452.18DEqtlS057853@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: 159a0e32d58f - stable/11 - apr: Merge r1889604, r1807975 from trunk: 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/11 X-Git-Reftype: branch X-Git-Commit: 159a0e32d58f9e7b8d511571935df21f4bfc02a9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 14:52:56 -0000 The branch stable/11 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=159a0e32d58f9e7b8d511571935df21f4bfc02a9 commit 159a0e32d58f9e7b8d511571935df21f4bfc02a9 Author: Joe Orton AuthorDate: 2021-07-02 11:10:33 +0000 Commit: Ed Maste CommitDate: 2021-09-13 14:51:58 +0000 apr: Merge r1889604, r1807975 from trunk: * random/unix/sha2.c (apr__SHA256_Final, apr__SHA256_End): Fix parameter buffer lengths to match declaration, avoiding GCC 11 warning. (no functional change) Bounds-check human-readable date fields (credit: Stefan Sperling) Submitted by: jorton, niq Reviewed by: jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1891198 13f79535-47bb-0310-9956-ffa450edef68 (cherry picked from commit fc1b69d0311e50ed05c00c46ad7dd5d560e57cb6) --- contrib/apr/random/unix/sha2.c | 4 ++-- contrib/apr/time/unix/time.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/apr/random/unix/sha2.c b/contrib/apr/random/unix/sha2.c index 12c257d1fa1b..8059a9d78a71 100644 --- a/contrib/apr/random/unix/sha2.c +++ b/contrib/apr/random/unix/sha2.c @@ -425,7 +425,7 @@ void apr__SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) usedspace = freespace = 0; } -void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { +void apr__SHA256_Final(sha2_byte digest[SHA256_DIGEST_LENGTH], SHA256_CTX* context) { sha2_word32 *d = (sha2_word32*)digest; unsigned int usedspace; @@ -496,7 +496,7 @@ void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { usedspace = 0; } -char *apr__SHA256_End(SHA256_CTX* context, char buffer[]) { +char *apr__SHA256_End(SHA256_CTX* context, char buffer[SHA256_DIGEST_STRING_LENGTH]) { sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; int i; diff --git a/contrib/apr/time/unix/time.c b/contrib/apr/time/unix/time.c index dfa45e690c62..7f0958192769 100644 --- a/contrib/apr/time/unix/time.c +++ b/contrib/apr/time/unix/time.c @@ -142,6 +142,9 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) static const int dayoffset[12] = {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; + if (xt->tm_mon < 0 || xt->tm_mon >= 12) + return APR_EBADDATE; + /* shift new year to 1st March in order to make leap year calc easy */ if (xt->tm_mon < 2)