If we're going to return errors (no matter how stupid), then we should
[openssl.git] / apps / ts.c
index 08b8c4a..74e7e93 100644 (file)
--- a/apps/ts.c
+++ b/apps/ts.c
@@ -598,6 +598,8 @@ static int create_digest(BIO *input, char *digest, const EVP_MD *md,
        int md_value_len;
 
        md_value_len = EVP_MD_size(md);
+       if (md_value_len < 0)
+           goto err;
        if (input)
                {
                /* Digest must be computed from an input file. */