summaryrefslogtreecommitdiff
path: root/lib/libcrypto/asn1
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2015-10-22 15:38:06 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2015-10-22 15:38:06 +0000
commit79be066ef8e4748605b33244562dae85744d1701 (patch)
treef4bfb3b1a1b7b6268ecfd3b8e609f6f0c41953aa /lib/libcrypto/asn1
parent722bbb37f93aec719b6718983d8b6758f3b1a8da (diff)
Another change that is needed to restore the previous behaviour of
ASN1_{GENERALIZED,UTC}TIME_set_string(), which allows it to be called with a NULL pointer. ok beck@
Diffstat (limited to 'lib/libcrypto/asn1')
-rw-r--r--lib/libcrypto/asn1/a_time_tm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libcrypto/asn1/a_time_tm.c b/lib/libcrypto/asn1/a_time_tm.c
index e5ef007bb9e..65de0d4f180 100644
--- a/lib/libcrypto/asn1/a_time_tm.c
+++ b/lib/libcrypto/asn1/a_time_tm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: a_time_tm.c,v 1.7 2015/10/22 15:03:19 jsing Exp $ */
+/* $OpenBSD: a_time_tm.c,v 1.8 2015/10/22 15:38:05 jsing Exp $ */
/*
* Copyright (c) 2015 Bob Beck <beck@openbsd.org>
*
@@ -369,7 +369,7 @@ ASN1_UTCTIME_check(ASN1_UTCTIME *d)
int
ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str)
{
- if (s->type != V_ASN1_UTCTIME)
+ if (s != NULL && s->type != V_ASN1_UTCTIME)
return (0);
return (ASN1_TIME_set_string_internal(s, str, V_ASN1_UTCTIME));
}
@@ -425,7 +425,7 @@ ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d)
int
ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)
{
- if (s->type != V_ASN1_GENERALIZEDTIME)
+ if (s != NULL && s->type != V_ASN1_GENERALIZEDTIME)
return (0);
return (ASN1_TIME_set_string_internal(s, str, V_ASN1_GENERALIZEDTIME));
}
@@ -443,5 +443,3 @@ ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, time_t t, int offset_day,
return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec,
V_ASN1_GENERALIZEDTIME));
}
-
-