From e33d290159de019a50ac40f1e33e020ee9c9e70b Mon Sep 17 00:00:00 2001
From: "Dr. Stephen Henson" <steve@openssl.org>
Date: Mon, 10 Aug 2009 14:56:57 +0000
Subject: [PATCH] PR: 2004 Submitted by: Peter Sylvester
 <peter.sylvester@edelweb.fr> Approved by: steve@openssl.org

Handle fractional seconds properly in ASN1_GENERALIZEDTIME_print
---
 crypto/asn1/t_x509.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/asn1/t_x509.c b/crypto/asn1/t_x509.c
index e504d50d5..e061f2ffa 100644
--- a/crypto/asn1/t_x509.c
+++ b/crypto/asn1/t_x509.c
@@ -376,7 +376,7 @@ int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
 		{
 		s=  (v[12]-'0')*10+(v[13]-'0');
 		/* Check for fractions of seconds. */
-		if (i >= 15 && v[14] == '.')
+		if (tm->length >= 15 && v[14] == '.')
 			{
 			int l = tm->length;
 			f = &v[14];	/* The decimal point. */