summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2001-03-27 16:50:36 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2001-03-27 16:50:36 +0000
commitb333e7bc5db3aac9a9b6a1f349e22da0fd8ad27f (patch)
tree7c05e2481d29f91288fc263fe68f10c273e3ac59
parenta7f64790ce07e3633bd4b1da92ec97434a8cada3 (diff)
Allocate a buffer large enough to contain the generated assertion.
Found with ElectricFence.
-rw-r--r--sbin/isakmpd/x509.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sbin/isakmpd/x509.c b/sbin/isakmpd/x509.c
index 12f4ef3bf83..1468e3d8e02 100644
--- a/sbin/isakmpd/x509.c
+++ b/sbin/isakmpd/x509.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.c,v 1.45 2001/03/14 21:13:24 tholo Exp $ */
+/* $OpenBSD: x509.c,v 1.46 2001/03/27 16:50:35 ho Exp $ */
/* $EOM: x509.c,v 1.54 2001/01/16 18:42:16 ho Exp $ */
/*
@@ -491,12 +491,11 @@ x509_generate_kn (X509 *cert)
return 0;
}
-
- buf = malloc (strlen (fmt2) + strlen (isname) + strlen (subname));
+ buf = malloc (strlen (fmt2) + strlen (isname) + strlen (subname) + 56);
if (!buf)
{
- log_error ("x509_generate_kn: malloc (%d) failed",
- strlen (fmt2) + strlen (isname) + strlen (subname));
+ log_error ("x509_generate_kn: malloc (%d) failed", strlen (fmt2) +
+ strlen (isname) + strlen (subname) + 56);
return 0;
}