diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2004-04-27 18:26:36 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2004-04-27 18:26:36 +0000 |
commit | 71520fa0b9894dfab56ef5279f7446d4a21d9c94 (patch) | |
tree | 4580bf1f27c3fe70184828e667ff09f5e3f2feb3 | |
parent | 12dc6a5f65855cc74a908774855653ee9bbfac91 (diff) |
don't loop forever on 0-size extensions
-rw-r--r-- | sbin/ipsecadm/pfkdump.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/ipsecadm/pfkdump.c b/sbin/ipsecadm/pfkdump.c index fd6d3b7f011..88093a03dd7 100644 --- a/sbin/ipsecadm/pfkdump.c +++ b/sbin/ipsecadm/pfkdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkdump.c,v 1.11 2004/02/02 16:04:54 markus Exp $ */ +/* $OpenBSD: pfkdump.c,v 1.12 2004/04/27 18:26:35 markus Exp $ */ /* * Copyright (c) 2003 Markus Friedl. All rights reserved. @@ -280,6 +280,7 @@ print_msg(struct sadb_msg *msg, int promisc) printf("\terrno %u: %s\n", msg->sadb_msg_errno, strerror(msg->sadb_msg_errno)); for (ext = (struct sadb_ext *)(msg + 1); + ext->sadb_ext_len > 0 && (u_int8_t *)ext - (u_int8_t *)msg < msg->sadb_msg_len * PFKEY2_CHUNK; ext = (struct sadb_ext *)((u_int8_t *)ext + |