diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-24 18:22:32 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-24 18:22:32 +0100 |
commit | 020ed0387e48fedf89224539d10db1bb464bb4a2 (patch) | |
tree | de1039b31f729f1d306fd7573fa68b2206cbe3ee /lib/element.c | |
parent | 76c0e3bca289c1001597dd7081e894f860cee0ec (diff) | |
download | libtasn1-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.c | 5 |
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: |