Skip to content

Commit 09b0447

Browse files
committed
pgm: don't advance bp by the option haeder length twice.
At those points, we've already advanced it by the option header length, and opt_len includes that length, so advance bp by opt_len minus the option header length. Fixes #1024.
1 parent 5a5646b commit 09b0447

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

print-pgm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ pgm_print(netdissect_options *ndo,
674674

675675
case PGM_OPT_PATH_NLA:
676676
ND_PRINT(" PATH_NLA [%u]", opt_len);
677-
bp += opt_len;
677+
bp += opt_len - 2;
678678
opts_len -= opt_len;
679679
break;
680680

@@ -716,7 +716,7 @@ pgm_print(netdissect_options *ndo,
716716

717717
case PGM_OPT_CR:
718718
ND_PRINT(" CR");
719-
bp += opt_len;
719+
bp += opt_len - 2;
720720
opts_len -= opt_len;
721721
break;
722722

@@ -820,7 +820,7 @@ pgm_print(netdissect_options *ndo,
820820

821821
default:
822822
ND_PRINT(" OPT_%02X [%u] ", opt_type, opt_len);
823-
bp += opt_len;
823+
bp += opt_len - 2;
824824
opts_len -= opt_len;
825825
break;
826826
}

0 commit comments

Comments
 (0)