diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2003-04-14 10:14:17 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2003-04-14 10:14:17 +0000 |
commit | 91d3ffe5845164b4a683f5814de198bfb401691a (patch) | |
tree | 984b866eb2e5c060b5a475a2e9ec238e0e62033d /sbin/isakmpd | |
parent | 290fddc3170d8a85d9969a968c64e8c5f8adc863 (diff) |
A "%d" is 12 chars, not 10. Use sizeof num instead of '10' in
snprintf. From Theo.
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r-- | sbin/isakmpd/pf_key_v2.c | 8 |
1 files 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: |