]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fixed off-by-one in serial length calculation
authorAdriaan de Jong <dejong@fox-it.com>
Tue, 28 Feb 2012 16:29:47 +0000 (17:29 +0100)
committerDavid Sommerseth <davids@redhat.com>
Thu, 29 Mar 2012 12:47:13 +0000 (14:47 +0200)
The serial length was one digit too short, resulting in missing digits
at the end of the certificate's stringified serial number.

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
src/openvpn/ssl_verify_polarssl.c

index 53e6006e1b4dc18c0261d23d6b49231a43d51652..85c44dd11d3c3d03ed1ef4dd0cc7cce124bcc462 100644 (file)
@@ -127,7 +127,7 @@ x509_get_serial (x509_cert *cert)
   int ret = 0;
   int i = 0;
   char *buf = NULL;
-  size_t len = cert->serial.len * 3;
+  size_t len = cert->serial.len * 3 + 1;
 
   buf = malloc(len);
   ASSERT(buf);