From nobody Sat Aug 03 22:23:11 2024 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 4Wbxzg4B3gz5RRhn; Sat, 03 Aug 2024 22:23:11 +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 4Wbxzg3PGnz4Dj7; Sat, 3 Aug 2024 22:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723791; 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=epEoYWr75qzlJNTCBezmrz7wcFZ5DLruYsvLnqnZtEk=; b=OOGcNAEYMJO2TRDQpHpSE8t3dsYmU2H3rkiPckMSf44irjrI2Pogaai3dJELYz+M4QgVqu BBPzt67wXukZr8ckkcoEC8GChnBuyTkSoDET4GpFKps7PdqCGwtUqzfdPIqsM1EWy8EyzY YmJ/v2wfwHQ3F8VPO16zcKhNoZDHva5EN++56oY7y10rjuHpDMNGZHuZgFFC6em+WA7yUF 9QWTSmpXgyGKNl4H2YZwcOJr+fByocD2oQHvkRXZuY2sltpVm5Eo+KozOpdeIB1WlRIeYe ekNgxYlfUb8F33RmjBM+DnGX3YXmR3LQX+c4siQJnMogbjQdwIsF6gsqfHiFsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722723791; a=rsa-sha256; cv=none; b=G8vS6GEP0TdzfquJiiti+BQECYDy+QU7YQ0mkvr4DKBl17cLfVOAbH2sWKoaL+YeuXHH9f rRZ+bhi3PzWFBfLeev2Y6+dnqdyEx3IGqbSqp0WfXZBmJlnJbnZVTwRguyn954nbD7tiRr QZKPLWYfcEq2Mj5PvIzVgv/ShVGRgX5rdLZdzyalVQUajZfmqqgl1XKhnO6ORyjC5+0EnH VkqqmeMYEhB0tUhAS6sJVoAh0T6a3NN8Q+MZd/MeaLXCdxN4zuWKw2RvJb7pIDHnvRusug QENLOy1ciIYRzK7LY6w5uP9yXnHCP7mHb6768RkXcsUQt23W/DVLNyoSHVdAjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723791; 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=epEoYWr75qzlJNTCBezmrz7wcFZ5DLruYsvLnqnZtEk=; b=fMVKKnhQg4utM5DD1qE/eaX34iQq2hFI2VfsCY/lZ0qRyvc4NBqJWLaFR99GhL5wYIWdhV RnWdxXlr8OiljMA8ymzQn6Dex+bJF3pizQ+i8SgEQNXwKzSUtnmt7/CX7ZwLx8bo2LLqik AdtFGeyZKWOfPIwVgbDzBrgFkojSGTesDy/TZlVoMd2RM+3Z4uGEIJxe6K+yGGvhVfVACB ZUHWWEkYzx/wqo3tF0nZgL05WusfeEzsZKuJ92FoHjwsCOkj5XGVzmGoApz/VLKUPhzCxP T+pWbsLkYSYW34qLCEr0Wyjszw8+NnNEd6izn12FPcYiTLSg7elifc5K66upMg== 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 4Wbxzg3136zSyg; Sat, 3 Aug 2024 22:23:11 +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 473MNBhj025417; Sat, 3 Aug 2024 22:23:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MNBRs025414; Sat, 3 Aug 2024 22:23:11 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:23:11 GMT Message-Id: <202408032223.473MNBRs025414@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 7663542fd713 - stable/14 - sctp: add missing check 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7663542fd71312e2648d212bf74c77fff310862e Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=7663542fd71312e2648d212bf74c77fff310862e commit 7663542fd71312e2648d212bf74c77fff310862e Author: Michael Tuexen AuthorDate: 2024-05-08 21:01:06 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:21:39 +0000 sctp: add missing check If memory allocation fails, m is NULL. Since this is possible, check for it. Reported by: Coverity Scan CID: 1086866 (cherry picked from commit 3d40cc7ab888a37a3ba085f377a057396a7d2476) --- sys/netinet/sctp_output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index a8facff6b917..e0106831f06a 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -6705,7 +6705,9 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, } else { m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_NOWAIT, 1, MT_DATA); - SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr); + if (m != NULL) { + SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr); + } } if (m != NULL) { struct sctp_paramhdr *ph;