From 12a765a5235f181c2f4992b615eb5f892c368e88 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Mon, 16 Sep 2019 15:28:57 -0400 Subject: Explicitly test against NULL; do not use !p or similar Also added blanks lines after declarations in a couple of places. Reviewed-by: Tomas Mraz Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/9916) --- apps/ts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apps/ts.c') diff --git a/apps/ts.c b/apps/ts.c index 4ef8a72eef..aef74adce8 100644 --- a/apps/ts.c +++ b/apps/ts.c @@ -507,8 +507,9 @@ static int create_digest(BIO *input, const char *digest, const EVP_MD *md, md_value_len = EVP_MD_size(md); } else { long digest_len; + *md_value = OPENSSL_hexstr2buf(digest, &digest_len); - if (!*md_value || md_value_len != digest_len) { + if (*md_value == NULL || md_value_len != digest_len) { OPENSSL_free(*md_value); *md_value = NULL; BIO_printf(bio_err, "bad digest, %d bytes " -- cgit v1.2.3