From 91d3ffe5845164b4a683f5814de198bfb401691a Mon Sep 17 00:00:00 2001 From: Hakan Olsson Date: Mon, 14 Apr 2003 10:14:17 +0000 Subject: A "%d" is 12 chars, not 10. Use sizeof num instead of '10' in snprintf. From Theo. --- sbin/isakmpd/pf_key_v2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c index 964bd2b142d..2e8a6a9b815 100644 --- a/sbin/isakmpd/pf_key_v2.c +++ b/sbin/isakmpd/pf_key_v2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_key_v2.c,v 1.122 2003/02/24 12:01:04 markus Exp $ */ +/* $OpenBSD: pf_key_v2.c,v 1.123 2003/04/14 10:14:16 ho Exp $ */ /* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */ /* @@ -3744,7 +3744,7 @@ pf_key_v2_acquire (struct pf_key_v2_msg *pmsg) { struct cert_handler *handler = 0; void *cert; - char num[10], *certprint; + char num[12], *certprint; /* Convert to bytes in-place. */ cred->sadb_x_cred_len *= PF_KEY_V2_CHUNK; @@ -3760,11 +3760,11 @@ pf_key_v2_acquire (struct pf_key_v2_msg *pmsg) switch (cred->sadb_x_cred_type) { case SADB_X_CREDTYPE_X509: - snprintf (num, 10, "%d", ISAKMP_CERTENC_X509_SIG); + snprintf (num, sizeof num, "%d", ISAKMP_CERTENC_X509_SIG); handler = cert_get (ISAKMP_CERTENC_X509_SIG); break; case SADB_X_CREDTYPE_KEYNOTE: - snprintf (num, 10, "%d", ISAKMP_CERTENC_KEYNOTE); + snprintf (num, sizeof num, "%d", ISAKMP_CERTENC_KEYNOTE); handler = cert_get (ISAKMP_CERTENC_KEYNOTE); break; default: -- cgit v1.2.3