-/* $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>
*
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));
}
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));
}
return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec,
V_ASN1_GENERALIZEDTIME));
}
-
-
-/* $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>
*
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));
}
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));
}
return (ASN1_TIME_adj_internal(s, t, offset_day, offset_sec,
V_ASN1_GENERALIZEDTIME));
}
-
-