diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-01-27 10:00:41 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-01-27 10:00:41 +0000 |
commit | aa3d01b018aef3a5c4435e9aba97a399c08b8995 (patch) | |
tree | 9c71c57f33b6a58558d1ee4021b1b3627dca14c3 /usr.sbin/tcpdump | |
parent | d9a9a3c14d6d573badcc7ba44033bc36b0f8d55f (diff) |
bugfix from Can Erkin Acar <canacar@eee.metu.edu.tr>:
hbhopt_print() and dstopt_print() can return 0 if
the option is located just one byte short of snapend
this would cause an infinite loop in ip6_print().
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r-- | usr.sbin/tcpdump/print-ip6.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/tcpdump/print-ip6.c b/usr.sbin/tcpdump/print-ip6.c index 156976d0d82..3dee1dc64a5 100644 --- a/usr.sbin/tcpdump/print-ip6.c +++ b/usr.sbin/tcpdump/print-ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ip6.c,v 1.3 2002/02/19 19:39:40 millert Exp $ */ +/* $OpenBSD: print-ip6.c,v 1.4 2003/01/27 10:00:40 henning Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 @@ -165,6 +165,8 @@ ip6_print(register const u_char *bp, register int length) (void)printf("ip-proto-%d %d", ip6->ip6_nxt, len); goto end; } + if (hlen == 0) + break; } end: |