diff options
author | Peter Valchev <pvalchev@cvs.openbsd.org> | 2007-06-02 01:29:13 +0000 |
---|---|---|
committer | Peter Valchev <pvalchev@cvs.openbsd.org> | 2007-06-02 01:29:13 +0000 |
commit | 01acd14e84aa80dc43b4a04c42224541bf77a5ec (patch) | |
tree | 228b2ea83ef9db7fc4ad4f8f1e9e7843ba9f573a /sbin/isakmpd/message.c | |
parent | bc5e767d3a388122b191e1a164586dc30794a30a (diff) |
safer snprintf construct with more paranoid length calculation
ok millert
Diffstat (limited to 'sbin/isakmpd/message.c')
-rw-r--r-- | sbin/isakmpd/message.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/isakmpd/message.c b/sbin/isakmpd/message.c index 1ce3900cf49..e71015d3bd8 100644 --- a/sbin/isakmpd/message.c +++ b/sbin/isakmpd/message.c @@ -1,4 +1,4 @@ -/* $OpenBSD: message.c,v 1.125 2007/04/16 13:01:39 moritz Exp $ */ +/* $OpenBSD: message.c,v 1.126 2007/06/02 01:29:11 pvalchev Exp $ */ /* $EOM: message.c,v 1.156 2000/10/10 12:36:39 provos Exp $ */ /* @@ -1931,7 +1931,7 @@ message_dump_raw(char *header, struct message *msg, int class) for (j = 0; j < msg->iov[i].iov_len; j++) { snprintf(p, sizeof buf - (int) (p - buf), "%02x", ((u_int8_t *) msg->iov[i].iov_base)[j]); - p += 2; + p += strlen(p); if (++k % 32 == 0) { *p = '\0'; LOG_DBG((class, 70, "%s: %s", header, buf)); |