diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-11-10 16:04:25 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-11-10 20:39:41 +0000 |
commit | b489b7ff7d4ba9f000f29c608515eb43059855ab (patch) | |
tree | 6efdf8a63b8ce32f173607e33e1f5f98f0a37973 /epan/dissectors/packet-lsd.c | |
parent | ce98b6c90dcbd8e9468bbac0adf10a7d537afdcb (diff) |
lsd: fix unaligned read
Fixes UBsan complaint:
epan/dissectors/packet-lsd.c:141:7: runtime error: load of misaligned address 0x61d00017029e for type 'const guint32', which requires 4 byte alignment
Change-Id: I74034f3e0bc198b4b86ca6cd7559d8df7283377f
Reviewed-on: https://code.wireshark.org/review/18733
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-lsd.c')
-rw-r--r-- | epan/dissectors/packet-lsd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/dissectors/packet-lsd.c b/epan/dissectors/packet-lsd.c index fa16c5d301..065d80b404 100644 --- a/epan/dissectors/packet-lsd.c +++ b/epan/dissectors/packet-lsd.c @@ -26,6 +26,7 @@ #include <epan/packet.h> #include <epan/expert.h> +#include <wsutil/pint.h> #include <wsutil/strtoi.h> void proto_register_lsd(void); @@ -138,7 +139,7 @@ dissect_lsd_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data if (pinfo->dst.type != AT_IPv4) return FALSE; - if (g_ntohl((*((const guint32 *)pinfo->dst.data))) != LSD_MULTICAST_ADDRESS) + if (pntoh32(pinfo->dst.data) != LSD_MULTICAST_ADDRESS) return FALSE; if (pinfo->destport != LSD_PORT) |