mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
pcapparse: Avoid unaligned memory access
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3602 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7030>
This commit is contained in:
parent
a20ef245a0
commit
4729d24bb6
1 changed files with 2 additions and 2 deletions
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in a new issue