diff mbox series

[2/2] smsutil: Check that submit report fits in memory

Message ID 20231221141638.19774-3-d.grigorev@omp.ru (mailing list archive)
State Superseded
Headers show
Series CVE-2023-4233 and CVE-2023-4234 | expand

Commit Message

Denis Grigorev Dec. 21, 2023, 2:16 p.m. UTC
This addresses CVE-2023-4234.
---
 src/smsutil.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Denis Kenzior Dec. 22, 2023, 7:38 p.m. UTC | #1
Hi Denis,

On 12/21/23 08:16, Denis Grigorev wrote:
> This addresses CVE-2023-4234.
> ---
>   src/smsutil.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 

Applied, thanks.

Regards,
-Denis
diff mbox series

Patch

diff --git a/src/smsutil.c b/src/smsutil.c
index e9551b0d..6edf9ee6 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -942,10 +942,16 @@  static gboolean decode_submit_report(const unsigned char *pdu, int len,
 			return FALSE;
 
 		if (out->type == SMS_TYPE_SUBMIT_REPORT_ERROR) {
+			if (expected > (int) sizeof(out->submit_err_report.ud))
+				return FALSE;
+
 			out->submit_err_report.udl = udl;
 			memcpy(out->submit_err_report.ud,
 					pdu + offset, expected);
 		} else {
+			if (expected > (int) sizeof(out->submit_ack_report.ud))
+				return FALSE;
+
 			out->submit_ack_report.udl = udl;
 			memcpy(out->submit_ack_report.ud,
 					pdu + offset, expected);