From 020ed0387e48fedf89224539d10db1bb464bb4a2 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sat, 24 Nov 2012 18:22:32 +0100 Subject: revert to use strlen when writing time values. --- lib/element.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/element.c') diff --git a/lib/element.c b/lib/element.c index a49758b..763ac58 100644 --- a/lib/element.c +++ b/lib/element.c @@ -500,6 +500,7 @@ asn1_write_value (asn1_node node_root, const char *name, break; case ASN1_ETYPE_UTC_TIME: { + len = _asn1_strlen(value); if (len < 11) return ASN1_VALUE_NOT_VALID; for (k = 0; k < 10; k++) @@ -539,8 +540,8 @@ asn1_write_value (asn1_node node_root, const char *name, } break; case ASN1_ETYPE_GENERALIZED_TIME: - if (value) - _asn1_set_value (node, value, len); + len = _asn1_strlen(value); + _asn1_set_value (node, value, len); break; case ASN1_ETYPE_OCTET_STRING: case ASN1_ETYPE_GENERALSTRING: -- cgit v1.2.3