BGP: Fix detection of additional path

When additional path index are in use there must be more remaining data bytes.
Therefore we return only 1 when the len is greater 1.

Bug has been reported by Garri.

Bug: 12240
Change-Id: Ia24311dcedc450e4208df875bc254c9744dec5dd
Reviewed-on: https://code.wireshark.org/review/14396
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Uli Heilmeier 2016-03-08 16:47:09 +01:00 committed by Michael Mann
parent bc59efc4e3
commit 48b807a364
1 changed files with 1 additions and 1 deletions

View File

@ -1971,7 +1971,7 @@ 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) {
if( prefix_len == 0 && end - offset > 1 ) {
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) {