From nobody Thu May 09 14:07:56 2024 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 4VZv3w73dHz5JmGw; Thu, 09 May 2024 14:07: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 4VZv3w6M99z43Qd; Thu, 9 May 2024 14:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715263676; 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=yH7UMmuBZW390vw6ewrjasijf3wLFpsRjpYvSYysr60=; b=tn9YaE0p0Nq2/mHP+9/L8BekVTX8/JPAqRGhghjBU1GxacuHEcAlzvNAA1j0tbEbdzWNF6 brQJzAHrvODXOOWXhX9icR8DF8UOjcEJfR9ur0kQwhTiRccj7292iis6Y30JFeVTSADslO DtGG/flUzkjGJh5YPCYBIyqGU19sarX1MTquBlFQZJQ+ztCrCqRC8UCeEfwByonwWIiqoM XvHrRj3oSfLOrSaA0/JhjGcnK0hlqCPgFtMTItV4vH9DTlKsgiXIP+Z1dcAyKSIrNYY1To m5GsNmfYVN42kc/xjnHJWaEX/lJYIaEXN9DYIr7eJ0XfR6wm0URNkgAf2UKM6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715263676; a=rsa-sha256; cv=none; b=HS4gSbOFKWCfpmsf0eFzXjlRMj7UAjIJcRcPqs0pUZ+pq5nGWoNM6yTyRqqDpiCrrUmqQA Q4tvVQP6X79JQOYLTk3XmlXoHOuAV4SkF/yKTEe8twLRBEDFiI9pn4BG8/Ysl8qoPhEDzJ dIUEAsPqxymhLbkiXS8YOxcVJGcTUMPqcv8GMMRSfScaOy7bdmUevKY2qg3kWlkg296I2t q9ybHFLnPi1Ydd1G3dDT2iOpVxPOyh0AePbb2GswazYkw+uR4kVRZC8EDG3tXbyfUNWjxw wCOVaR3Hw0rH6T0lAmhfnlK8BlWcCOSLD7f+YyiSrysKhK9p1lg7odAslzpFKw== 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=1715263676; 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=yH7UMmuBZW390vw6ewrjasijf3wLFpsRjpYvSYysr60=; b=WNTuPKW20NgJs5wbNcKBNKgAc0kPCxJLsj+HVR1SO0YfQJ0j/tx02rzWzxpk8Pm9MxovjQ yg5jdeUkKccxR8yR/6mAxbNKr5mnvH3PABo2FEDjZnMhxsXL0RLSnIXcqTMqaVTev0D7tz 0mNJUl5/eCmkC3sRUSHNREMqqfwS/pJmWZmsi73/rcGZ2zv5pdEIKZAyjUdjqkXYAwjfs/ bPQgzu+vCLLrjFeGLz4fTkKzIOQWcALZ2uQNRK3wuTKANcSkDPDvlRUS2+9du3MgW8Jc07 U/Rgl1lNAIeJjxSt9z+M7c7ykNhiDPOxVT84wp255DxbQKYSUs3jUGda0VenKg== 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 4VZv3w5yYhz1BJp; Thu, 9 May 2024 14:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 449E7udZ017751; Thu, 9 May 2024 14:07:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449E7ul5017748; Thu, 9 May 2024 14:07:56 GMT (envelope-from git) Date: Thu, 9 May 2024 14:07:56 GMT Message-Id: <202405091407.449E7ul5017748@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 3d40cc7ab888 - main - sctp: add missing check 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d40cc7ab888a37a3ba085f377a057396a7d2476 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3d40cc7ab888a37a3ba085f377a057396a7d2476 commit 3d40cc7ab888a37a3ba085f377a057396a7d2476 Author: Michael Tuexen AuthorDate: 2024-05-08 21:01:06 +0000 Commit: Michael Tuexen CommitDate: 2024-05-08 21:03:34 +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 MFC after: 3 days --- 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;