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>
This commit is contained in:
Peter Wu 2016-11-10 16:04:25 +01:00 committed by Michael Mann
parent ce98b6c90d
commit b489b7ff7d
1 changed files with 2 additions and 1 deletions

View File

@ -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)