diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-12-27 02:57:22 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-12-27 10:58:11 +0000 |
commit | c04aebd761dbbd6228a76cfc0d0c04e8838b4cb6 (patch) | |
tree | 311da0c62353b71cc868e2cfaa8f0629fbc46d5f /epan | |
parent | ca6f84916f089a7c04dd13dbc6f90a17a6e049b4 (diff) |
Declare cur_rt in the narrowest possible scope.
Change-Id: I0604d6f9f4bb2c58bb74a9b375f644474b68c28f
Reviewed-on: https://code.wireshark.org/review/6074
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ip.c | 3 |
1 files changed, 2 insertions, 1 deletions
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), |