diff options
author | Cedric Berger <cedric@cvs.openbsd.org> | 2003-03-06 13:48:19 +0000 |
---|---|---|
committer | Cedric Berger <cedric@cvs.openbsd.org> | 2003-03-06 13:48:19 +0000 |
commit | a1039563ca663d0037e7b06f60291f0edd48d670 (patch) | |
tree | b06b307225eaf5345c05a85d48b20cbaf52186e7 /sbin/isakmpd | |
parent | a8b0bcddbef6618d39d958e9be15fa2840135328 (diff) |
"len" is decremented too early, so the second argument
of the snprintf call is too small on last run of the loop.
ok ho@
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r-- | sbin/isakmpd/field.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/isakmpd/field.c b/sbin/isakmpd/field.c index 4072945a57e..4e8d4b97cf0 100644 --- a/sbin/isakmpd/field.c +++ b/sbin/isakmpd/field.c @@ -1,4 +1,4 @@ -/* $OpenBSD: field.c,v 1.10 2002/01/23 18:44:47 ho Exp $ */ +/* $OpenBSD: field.c,v 1.11 2003/03/06 13:48:18 cedric Exp $ */ /* $EOM: field.c,v 1.11 2000/02/20 19:58:37 niklas Exp $ */ /* @@ -76,7 +76,7 @@ field_debug_raw (u_int8_t *buf, size_t len, struct constant_map **maps) return 0; strlcpy (retval, "0x", 3 + len * 2); p = retval + 2; - while (len--) + for(; len > 0; len--) { snprintf (p, 1 + len * 2, "%02x", *buf++); p += 2; |