X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fasn1%2Fa_time.c;h=83c57ce7a660f3d0fc27fcbc9c47646e34b00151;hp=e5b5f9a052a8a099cca3bce227bc77548d00c41d;hb=52b6e17da4c8eea982a19d1a1f34ba24416fb73e;hpb=d67e755418b62fb451ec221c126c9935a06ea63b;ds=sidebyside diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c index e5b5f9a052..83c57ce7a6 100644 --- a/crypto/asn1/a_time.c +++ b/crypto/asn1/a_time.c @@ -297,8 +297,9 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, if (out == NULL || *out == NULL) { if ((ret = ASN1_GENERALIZEDTIME_new()) == NULL) goto err; - } else + } else { ret = *out; + } /* If already GeneralizedTime just copy across */ if (t->type == V_ASN1_GENERALIZEDTIME) { @@ -349,7 +350,7 @@ int ASN1_TIME_set_string(ASN1_TIME *s, const char *str) return 0; } - if (s && !ASN1_STRING_copy((ASN1_STRING *)s, (ASN1_STRING *)&t)) + if (s != NULL && !ASN1_STRING_copy((ASN1_STRING *)s, (ASN1_STRING *)&t)) return 0; return 1; @@ -421,7 +422,7 @@ int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm) time(&now_t); memset(tm, 0, sizeof(*tm)); - if (OPENSSL_gmtime(&now_t, tm)) + if (OPENSSL_gmtime(&now_t, tm) != NULL) return 1; return 0; } @@ -448,5 +449,5 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) if (tm->type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_print(bp, tm); BIO_write(bp, "Bad time value", 14); - return (0); + return 0; }