From c04aebd761dbbd6228a76cfc0d0c04e8838b4cb6 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 27 Dec 2014 02:57:22 -0800 Subject: [PATCH] Declare cur_rt in the narrowest possible scope. Change-Id: I0604d6f9f4bb2c58bb74a9b375f644474b68c28f Reviewed-on: https://code.wireshark.org/review/6074 Reviewed-by: Guy Harris --- epan/dissectors/packet-ip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index f23484764d..a0c592f95e 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -2294,7 +2294,6 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) if (tree) { const char *dst_host; - guint32 cur_rt; memcpy(&addr, iph->ip_dst.data, 4); dst_host = get_hostname(addr); @@ -2304,6 +2303,8 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) } if (dst_off) { + guint32 cur_rt; + cur_rt = tvb_get_ipv4(tvb, offset + 16); if (ip_summary_in_tree) { proto_item_append_text(ti, ", Via: %s (%s)", get_hostname(cur_rt),