crypto/evp/m_sigver.c:173: error: UNINITIALIZED_VALUE
  The value read from mdlen was never initialized.
Showing all 1 steps of the trace


crypto/evp/m_sigver.c:173:13: 
171.           if (sctx || !r)
172.               return r;
173. >         if (EVP_PKEY_sign(ctx->pctx, sigret, siglen, md, mdlen) <= 0)
174.               return 0;
175.       } else {

int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
                        size_t *siglen)
{
    int sctx, r = 0;
    EVP_PKEY_CTX *pctx = ctx->pctx;
    if (pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM) {
        if (!sigret)
            return pctx->pmeth->signctx(pctx, sigret, siglen, ctx);
        if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE)
            r = pctx->pmeth->signctx(pctx, sigret, siglen, ctx);
        else {
            EVP_PKEY_CTX *dctx = EVP_PKEY_CTX_dup(ctx->pctx);
            if (!dctx)
                return 0;
            r = dctx->pmeth->signctx(dctx, sigret, siglen, ctx);
            EVP_PKEY_CTX_free(dctx);
        }
        return r;
    }
    if (pctx->pmeth->signctx)
        sctx = 1;
    else
        sctx = 0;
    if (sigret) {
        unsigned char md[EVP_MAX_MD_SIZE];
        unsigned int mdlen;
        if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE) {
            if (sctx)
                r = ctx->pctx->pmeth->signctx(ctx->pctx, sigret, siglen, ctx);
            else
                r = EVP_DigestFinal_ex(ctx, md, &mdlen);
        } else {
            EVP_MD_CTX tmp_ctx;
            EVP_MD_CTX_init(&tmp_ctx);
            if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx))
                return 0;
            if (sctx)
                r = tmp_ctx.pctx->pmeth->signctx(tmp_ctx.pctx,
                                                 sigret, siglen, &tmp_ctx);
            else
                r = EVP_DigestFinal_ex(&tmp_ctx, md, &mdlen);
            EVP_MD_CTX_cleanup(&tmp_ctx);
        }
        if (sctx || !r)
            return r;
        if (EVP_PKEY_sign(ctx->pctx, sigret, siglen, md, mdlen) <= 0)
            return 0;
    } else {
        if (sctx) {
            if (pctx->pmeth->signctx(pctx, sigret, siglen, ctx) <= 0)
                return 0;
        } else {
            int s = EVP_MD_size(ctx->digest);
            if (s < 0 || EVP_PKEY_sign(pctx, sigret, siglen, NULL, s) <= 0)
                return 0;
        }
    }
    return 1;
}
['int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,\n                        size_t *siglen)\n{\n    int sctx, r = 0;\n    EVP_PKEY_CTX *pctx = ctx->pctx;\n    if (pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM) {\n        if (!sigret)\n            return pctx->pmeth->signctx(pctx, sigret, siglen, ctx);\n        if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE)\n            r = pctx->pmeth->signctx(pctx, sigret, siglen, ctx);\n        else {\n            EVP_PKEY_CTX *dctx = EVP_PKEY_CTX_dup(ctx->pctx);\n            if (!dctx)\n                return 0;\n            r = dctx->pmeth->signctx(dctx, sigret, siglen, ctx);\n            EVP_PKEY_CTX_free(dctx);\n        }\n        return r;\n    }\n    if (pctx->pmeth->signctx)\n        sctx = 1;\n    else\n        sctx = 0;\n    if (sigret) {\n        unsigned char md[EVP_MAX_MD_SIZE];\n        unsigned int mdlen;\n        if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE) {\n            if (sctx)\n                r = ctx->pctx->pmeth->signctx(ctx->pctx, sigret, siglen, ctx);\n            else\n                r = EVP_DigestFinal_ex(ctx, md, &mdlen);\n        } else {\n            EVP_MD_CTX tmp_ctx;\n            EVP_MD_CTX_init(&tmp_ctx);\n            if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx))\n                return 0;\n            if (sctx)\n                r = tmp_ctx.pctx->pmeth->signctx(tmp_ctx.pctx,\n                                                 sigret, siglen, &tmp_ctx);\n            else\n                r = EVP_DigestFinal_ex(&tmp_ctx, md, &mdlen);\n            EVP_MD_CTX_cleanup(&tmp_ctx);\n        }\n        if (sctx || !r)\n            return r;\n        if (EVP_PKEY_sign(ctx->pctx, sigret, siglen, md, mdlen) <= 0)\n            return 0;\n    } else {\n        if (sctx) {\n            if (pctx->pmeth->signctx(pctx, sigret, siglen, ctx) <= 0)\n                return 0;\n        } else {\n            int s = EVP_MD_size(ctx->digest);\n            if (s < 0 || EVP_PKEY_sign(pctx, sigret, siglen, NULL, s) <= 0)\n                return 0;\n        }\n    }\n    return 1;\n}']