blob: 63715380e0421f11ed2cd7cfe8e4a8f4a922c33b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
This patch differs from upstream in the following way(s):
* Paths changed to accommodate 'builddir'
From 10930661ee8ab2f43078ece482c33ca74c2440fb Mon Sep 17 00:00:00 2001
From: Zach van Rijn <me@zv.io>
Date: Thu, 13 Jun 2024 09:11:30 -0500
Subject: [PATCH] pcapparse: Avoid unaligned memory access
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3602
---
subprojects/gst-plugins-bad/gst/pcapparse/gstpcapparse.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/subprojects/gst-plugins-bad/gst/pcapparse/gstpcapparse.c b/subprojects/gst-plugins-bad/gst/pcapparse/gstpcapparse.c
index 53e7ef6fc25..0a9c9a6063b 100644
--- a/gst/pcapparse/gstpcapparse.c
+++ b/gst/pcapparse/gstpcapparse.c
@@ -456,8 +456,8 @@ gst_pcap_parse_scan_frame (GstPcapParse * self,
return FALSE;
/* ip info */
- ip_src_addr = *((guint32 *) (buf_ip + 12));
- ip_dst_addr = *((guint32 *) (buf_ip + 16));
+ memcpy(&ip_src_addr, buf_ip + 12, sizeof(ip_src_addr));
+ memcpy(&ip_dst_addr, buf_ip + 16, sizeof(ip_dst_addr));
buf_proto = buf_ip + ip_header_size;
ip_packet_len = GUINT16_FROM_BE (*(guint16 *) (buf_ip + 2));
--
GitLab
|