From: Dr. Stephen Henson Date: Fri, 4 Sep 2009 11:31:19 +0000 (+0000) Subject: Oops, s can be NULL X-Git-Tag: OpenSSL_1_0_0-beta4~86 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b4f249e0d878d1037dc52d4fb96a657589ce5e5;p=openssl Oops, s can be NULL --- diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index 62b01441b6..c680980f8a 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -1759,17 +1759,15 @@ ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s, int offset_day, long offset_sec, time_t *in_tm) { time_t t; - int type = -1; if (in_tm) t = *in_tm; else time(&t); - if (s) type = s->type; - if (!(s->flags & ASN1_STRING_FLAG_MSTRING)) + if (s && !(s->flags & ASN1_STRING_FLAG_MSTRING)) { - if (type == V_ASN1_UTCTIME) + if (s->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_adj(s,t, offset_day, offset_sec); - if (type == V_ASN1_GENERALIZEDTIME) + if (s->type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_adj(s, t, offset_day, offset_sec); }