All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] smsutil: check deliver reports fit in buffer
@ 2024-12-04  8:18 Sicelo A. Mhlongo
  2024-12-04  8:18 ` [PATCH 2/2] smsutil: check status report fits " Sicelo A. Mhlongo
  2024-12-04 18:20 ` [PATCH 1/2] smsutil: check deliver reports fit " patchwork-bot+ofono
  0 siblings, 2 replies; 5+ messages in thread
From: Sicelo A. Mhlongo @ 2024-12-04  8:18 UTC (permalink / raw)
  To: ofono; +Cc: Sicelo A. Mhlongo

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

diff --git a/src/smsutil.c b/src/smsutil.c
index 8f578c22..bdb1d04f 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -1226,10 +1226,16 @@ static gboolean decode_deliver_report(const unsigned char *pdu, int len,
 			return FALSE;
 
 		if (out->type == SMS_TYPE_DELIVER_REPORT_ERROR) {
+			if (expected > (int) sizeof(out->deliver_err_report.ud))
+				return FALSE;
+
 			out->deliver_err_report.udl = udl;
 			memcpy(out->deliver_err_report.ud,
 					pdu + offset, expected);
 		} else {
+			if (expected > (int) sizeof(out->deliver_ack_report.ud))
+				return FALSE;
+
 			out->deliver_ack_report.udl = udl;
 			memcpy(out->deliver_ack_report.ud,
 					pdu + offset, expected);
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-04 18:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-04  8:18 [PATCH 1/2] smsutil: check deliver reports fit in buffer Sicelo A. Mhlongo
2024-12-04  8:18 ` [PATCH 2/2] smsutil: check status report fits " Sicelo A. Mhlongo
2024-12-04  9:55   ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.