summaryrefslogtreecommitdiff
path: root/lib/element.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-11-24 18:22:32 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-11-24 18:22:32 +0100
commit020ed0387e48fedf89224539d10db1bb464bb4a2 (patch)
treede1039b31f729f1d306fd7573fa68b2206cbe3ee /lib/element.c
parent76c0e3bca289c1001597dd7081e894f860cee0ec (diff)
downloadlibtasn1-020ed0387e48fedf89224539d10db1bb464bb4a2.tar.gz
libtasn1-020ed0387e48fedf89224539d10db1bb464bb4a2.tar.bz2
libtasn1-020ed0387e48fedf89224539d10db1bb464bb4a2.zip
revert to use strlen when writing time values.
Diffstat (limited to 'lib/element.c')
-rw-r--r--lib/element.c5
1 files changed, 3 insertions, 2 deletions
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: