public inbox for ofono@lists.linux.dev
 help / color / mirror / Atom feed
From: "Sicelo A. Mhlongo" <absicsz@gmail.com>
To: ofono@lists.linux.dev
Cc: "Sicelo A. Mhlongo" <absicsz@gmail.com>
Subject: [PATCH 2/2] smsutil: check status report fits in buffer
Date: Wed,  4 Dec 2024 10:18:52 +0200	[thread overview]
Message-ID: <20241204082207.24692-2-absicsz@gmail.com> (raw)
In-Reply-To: <20241204082207.24692-1-absicsz@gmail.com>

Fixes CVE-2023-4232
---
 src/smsutil.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/smsutil.c b/src/smsutil.c
index bdb1d04f..8c1aaad3 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -1077,6 +1077,9 @@ static gboolean decode_status_report(const unsigned char *pdu, int len,
 		if ((len - offset) < expected)
 			return FALSE;
 
+		if (expected > (int)sizeof(out->status_report.ud))
+			return FALSE;
+
 		memcpy(out->status_report.ud, pdu + offset, expected);
 	}
 
-- 
2.45.2


  reply	other threads:[~2024-12-04  8:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04  8:18 [PATCH 1/2] smsutil: check deliver reports fit in buffer Sicelo A. Mhlongo
2024-12-04  8:18 ` Sicelo A. Mhlongo [this message]
2024-12-04  9:55   ` [PATCH 2/2] smsutil: check status report fits " Marcel Holtmann
2024-12-04 18:06     ` Denis Kenzior
2024-12-04 18:20 ` [PATCH 1/2] smsutil: check deliver reports fit " patchwork-bot+ofono

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241204082207.24692-2-absicsz@gmail.com \
    --to=absicsz@gmail.com \
    --cc=ofono@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox