From nobody Thu Aug 01 20:57:17 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 4WZh9T46bFz5RRnv; Thu, 01 Aug 2024 20:57:17 +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 4WZh9T2sM2z4P4r; Thu, 1 Aug 2024 20:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722545837; 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=5g+pHC5XhKz9Lv8gJL9nOuYEyZPgua7BxbEYq3dEgk4=; b=oYevxK4aec9KXMl2ch1LmIY3nje/8gypsdVF9NnCEUUnBCAXM87HmU5UDN54Z7zN5yvUWH y1Q8JCnmfxhM7LM4tmIvSckHLRzlJTUrfrcScAQH6q8PisQhx8pRfkqefG+AcJQ8785YHR rkMYRu5Jl/rhbMp6GbA1ss2ylgyhwZhJ59m8yQUUXKxps1t1VTFGY+xp/S598Va76iXHvY k/9Qi4BqkMXfQhw4blDgA01LRIhAjU5L7rKAClyhHP3XFqQXJ4dCFFCP1yNseG8b1hiN5M WGwDCT3z++IvilTPYPkdJpoJzeFyunsExyr47NiAHd9zw+9BlihkdkuhVlOOiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722545837; a=rsa-sha256; cv=none; b=mC445JkBGW85gQqqW0pveKbmScjwqx9qKZlHziFpfHt6cQHbNvjjDLLI2cnICerBcv/gbq Jwm1ext/liXFi1okGQ308qj8gYWBr8rgxVdxN9NIfUv0FASOhr8wevtTaekBlmzlzNGUQw jh9MhwcK/7NTn4HjhsOOu8JGU78ggH/aRQRj6mJ4U9O3zMCOaP4/jZRX07vLBkI9XOnELS d8UaKye/7XSUOJYl1pJ9wno3p+2mDV5D6wQ00tZJdJeZ4B/mQAphc1grKXOHxPhmGN3SO8 Cu9+/Tq1am+pGJ6S9lRlil+vnhIb5YZMX49s9L2X0D1Rdmnnidhm3wLqMY/Pcw== 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=1722545837; 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=5g+pHC5XhKz9Lv8gJL9nOuYEyZPgua7BxbEYq3dEgk4=; b=Wbc7w5DXDUY4TYYQahr0RXnWt9H0O2RO89iKjXj2kpz/OEcxbsFHsii5TjaH958j+MkvWL yIXreROQfbWS36w+EK0ClDr8nawdPsjFF4Y1Zm12327PJJpCby5B+n1exS+U+vT0Fc/AhR hHaOae90KWaaWuZ0pLz+EiyCiHYT6rjGXaFtplb1cbedBfB5Yfpv4m2mSDHWrumtqmZMRP Hk0913kn1oDvtv/iMiL9cDyKuh6nUNh5nrXKNNbsDBtgiCOj814mHWX8pEuni5OIFkN4AD BGMuTsWhmlETRev+/fJZ9iR1G9d/2S57o3+uEE7OuU/pkSyM1Qmj9pwQiFf+zw== 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 4WZh9T25PPz103b; Thu, 1 Aug 2024 20:57:17 +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 471KvHXV072286; Thu, 1 Aug 2024 20:57:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KvHPq072283; Thu, 1 Aug 2024 20:57:17 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:57:17 GMT Message-Id: <202408012057.471KvHPq072283@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: 75ee09cf628c - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 75ee09cf628c6cfb58a26283fcf1c05b5c97306f Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=75ee09cf628c6cfb58a26283fcf1c05b5c97306f commit 75ee09cf628c6cfb58a26283fcf1c05b5c97306f Author: Michael Tuexen AuthorDate: 2024-05-08 21:01:06 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:56:27 +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 f13010e54521..13a9a65da9eb 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -6635,7 +6635,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;