wireshark/CVE-2024-4853.patch
starlet-dx a83aed463a Fix CVE-2024-4853,CVE-2024-4854 and CVE-2024-4855
(cherry picked from commit 25172a75a967548218af7b18d163e8e613ebd3d1)
2024-05-15 11:32:03 +08:00

34 lines
1.1 KiB
Diff

From 683166c81bc1f8a6268f4955654bfd64ca98c07a Mon Sep 17 00:00:00 2001
From: John Thacker <johnthacker@gmail.com>
Date: Fri, 29 Mar 2024 09:42:44 -0400
Subject: [PATCH] editcap: Don't memmove more than allocated in the buffer
When moving from the begining with a beginning offset specified,
don't run off the end. Subtract the source memory area's full offset
from the beginning of the buffer from the capture length.
Fix #19724
(cherry picked from commit 7c744e7933794b09e7af4d9703194ad0b01be282)
---
editcap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/editcap.c b/editcap.c
index 3b5a70127ee..f64a8155576 100644
--- a/editcap.c
+++ b/editcap.c
@@ -2462,7 +2462,7 @@ handle_chopping(chop_t chop, wtap_packet_header *out_phdr,
if (chop.off_begin_pos > 0) {
memmove(*buf + chop.off_begin_pos,
*buf + chop.off_begin_pos + chop.len_begin,
- out_phdr->caplen - chop.len_begin);
+ out_phdr->caplen - (chop.off_begin_pos + chop.len_begin));
} else {
*buf += chop.len_begin;
}
--
GitLab