diff options
author | Pyeole <pyeole@ncsu.edu> | 2015-08-29 15:36:41 -0400 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-08-30 13:48:31 +0000 |
commit | faaa6f2a34255efb9a4ce36033328bf8153d0d41 (patch) | |
tree | 295e79f4802e7a12fc77975c7664e23899edd550 /epan/dissectors/packet-bgp.c | |
parent | e0a87d8cd1c738a012295f8cbf107de7fe131a75 (diff) | |
download | wireshark-faaa6f2a34255efb9a4ce36033328bf8153d0d41.tar.gz |
BGP: fixed incorrect NLRI decoding
Bug: 11308
Change-Id: I967b9596edad1e3656e139d0ca3a0e3c389d80ea
Reviewed-on: https://code.wireshark.org/review/10308
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-bgp.c')
-rw-r--r-- | epan/dissectors/packet-bgp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c index 25f012c7bf..0501f14a58 100644 --- a/epan/dissectors/packet-bgp.c +++ b/epan/dissectors/packet-bgp.c @@ -53,6 +53,9 @@ * Destination Preference Attribute for BGP (work in progress) * RFC1863 A BGP/IDRP Route Server alternative to a full mesh routing */ +/* (c) Copyright 2015, Pratik Yeole <pyeole@ncsu.edu> + - Fixed incorrect decoding of Network Layer Reachability Information (NLRI) in BGP UPDATE message with add-path support + */ #include "config.h" @@ -1718,6 +1721,9 @@ detect_add_path_prefix4(tvbuff_t *tvb, gint offset, gint end) { /* Must NOT be compatible with standard BGP */ for (o = offset; o < end; ) { prefix_len = tvb_get_guint8(tvb, o); + if( prefix_len == 0) { + return 1; /* prefix length is zero (i.e. matching all IP prefixes) and remaining bytes within the NLRI is greater than or equal to 1 - may be BGP add-path */ + } if( prefix_len > 32) { return 1; /* invalid prefix length - may be BGP add-path */ } |