From 7d2629d9468a1bf8f3cc673bcb993e6c00ebb1e4 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 2 Aug 2020 11:33:06 -0700 Subject: [PATCH] null: use tvb_get_h_guint32() to fetch a host byte order value. Change-Id: Ie73165d1018aab0553fc2322a8631ff0b8d549fb Reviewed-on: https://code.wireshark.org/review/38029 Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- epan/dissectors/packet-null.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-null.c b/epan/dissectors/packet-null.c index 8ae6d23f76..98c32e050c 100644 --- a/epan/dissectors/packet-null.c +++ b/epan/dissectors/packet-null.c @@ -337,9 +337,10 @@ dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ col_set_str(pinfo->cinfo, COL_INFO, "Null/Loopback"); /* - * Treat it as a normal DLT_NULL header. + * Treat it as a normal DLT_NULL header. Fetch it in host + * byte order. */ - tvb_memcpy(tvb, (guint8 *)&null_header, 0, sizeof(null_header)); + null_header = tvb_get_h_guint32(tvb, 0); if ((null_header & 0xFFFF0000) != 0) { /*