summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/log.c
diff options
context:
space:
mode:
authorPeter Valchev <pvalchev@cvs.openbsd.org>2007-06-02 01:29:13 +0000
committerPeter Valchev <pvalchev@cvs.openbsd.org>2007-06-02 01:29:13 +0000
commit01acd14e84aa80dc43b4a04c42224541bf77a5ec (patch)
tree228b2ea83ef9db7fc4ad4f8f1e9e7843ba9f573a /sbin/isakmpd/log.c
parentbc5e767d3a388122b191e1a164586dc30794a30a (diff)
safer snprintf construct with more paranoid length calculation
ok millert
Diffstat (limited to 'sbin/isakmpd/log.c')
-rw-r--r--sbin/isakmpd/log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/isakmpd/log.c b/sbin/isakmpd/log.c
index 77376d47148..c52086f5dcf 100644
--- a/sbin/isakmpd/log.c
+++ b/sbin/isakmpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.59 2006/09/19 10:48:41 otto Exp $ */
+/* $OpenBSD: log.c,v 1.60 2007/06/02 01:29:11 pvalchev Exp $ */
/* $EOM: log.c,v 1.30 2000/09/29 08:19:23 niklas Exp $ */
/*
@@ -259,7 +259,7 @@ log_debug_buf(int cls, int level, const char *header, const u_int8_t *buf,
log_debug(cls, level, "%s:", header);
for (i = j = 0; i < sz;) {
snprintf(s + j, sizeof s - j, "%02x", buf[i++]);
- j += 2;
+ j += strlen(s + j);
if (i % 4 == 0) {
if (i % 32 == 0) {
s[j] = '\0';