crypto/evp/p_sign.c:111: error: UNINITIALIZED_VALUE
  The value read from m_len was never initialized.
Showing all 1 steps of the trace


crypto/evp/p_sign.c:111:13: 
109.           if (EVP_PKEY_CTX_set_signature_md(pkctx, ctx->digest) <= 0)
110.               goto err;
111. >         if (EVP_PKEY_sign(pkctx, sigret, &sltmp, m, m_len) <= 0)
112.               goto err;
113.           *siglen = sltmp;

int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
                  unsigned int *siglen, EVP_PKEY *pkey)
{
    unsigned char m[EVP_MAX_MD_SIZE];
    unsigned int m_len;
    int i = 0, ok = 0, v;
    EVP_PKEY_CTX *pkctx = NULL;
    *siglen = 0;
    if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE) {
        if (!EVP_DigestFinal_ex(ctx, m, &m_len))
            goto err;
    } else {
        int rv;
        EVP_MD_CTX tmp_ctx;
        EVP_MD_CTX_init(&tmp_ctx);
        rv = EVP_MD_CTX_copy_ex(&tmp_ctx, ctx);
        if (rv)
            rv = EVP_DigestFinal_ex(&tmp_ctx, m, &m_len);
        EVP_MD_CTX_cleanup(&tmp_ctx);
        if (!rv)
            return 0;
    }
    if (ctx->digest->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE) {
        size_t sltmp = (size_t)EVP_PKEY_size(pkey);
        i = 0;
        pkctx = EVP_PKEY_CTX_new(pkey, NULL);
        if (!pkctx)
            goto err;
        if (EVP_PKEY_sign_init(pkctx) <= 0)
            goto err;
        if (EVP_PKEY_CTX_set_signature_md(pkctx, ctx->digest) <= 0)
            goto err;
        if (EVP_PKEY_sign(pkctx, sigret, &sltmp, m, m_len) <= 0)
            goto err;
        *siglen = sltmp;
        i = 1;
 err:
        EVP_PKEY_CTX_free(pkctx);
        return i;
    }
    for (i = 0; i < 4; i++) {
        v = ctx->digest->required_pkey_type[i];
        if (v == 0)
            break;
        if (pkey->type == v) {
            ok = 1;
            break;
        }
    }
    if (!ok) {
        EVPerr(EVP_F_EVP_SIGNFINAL, EVP_R_WRONG_PUBLIC_KEY_TYPE);
        return (0);
    }
    if (ctx->digest->sign == NULL) {
        EVPerr(EVP_F_EVP_SIGNFINAL, EVP_R_NO_SIGN_FUNCTION_CONFIGURED);
        return (0);
    }
    return ctx->digest->sign(ctx->digest->type, m, m_len, sigret, siglen,
                             pkey->pkey.ptr);
}
['int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,\n                  unsigned int *siglen, EVP_PKEY *pkey)\n{\n    unsigned char m[EVP_MAX_MD_SIZE];\n    unsigned int m_len;\n    int i = 0, ok = 0, v;\n    EVP_PKEY_CTX *pkctx = NULL;\n    *siglen = 0;\n    if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE) {\n        if (!EVP_DigestFinal_ex(ctx, m, &m_len))\n            goto err;\n    } else {\n        int rv;\n        EVP_MD_CTX tmp_ctx;\n        EVP_MD_CTX_init(&tmp_ctx);\n        rv = EVP_MD_CTX_copy_ex(&tmp_ctx, ctx);\n        if (rv)\n            rv = EVP_DigestFinal_ex(&tmp_ctx, m, &m_len);\n        EVP_MD_CTX_cleanup(&tmp_ctx);\n        if (!rv)\n            return 0;\n    }\n    if (ctx->digest->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE) {\n        size_t sltmp = (size_t)EVP_PKEY_size(pkey);\n        i = 0;\n        pkctx = EVP_PKEY_CTX_new(pkey, NULL);\n        if (!pkctx)\n            goto err;\n        if (EVP_PKEY_sign_init(pkctx) <= 0)\n            goto err;\n        if (EVP_PKEY_CTX_set_signature_md(pkctx, ctx->digest) <= 0)\n            goto err;\n        if (EVP_PKEY_sign(pkctx, sigret, &sltmp, m, m_len) <= 0)\n            goto err;\n        *siglen = sltmp;\n        i = 1;\n err:\n        EVP_PKEY_CTX_free(pkctx);\n        return i;\n    }\n    for (i = 0; i < 4; i++) {\n        v = ctx->digest->required_pkey_type[i];\n        if (v == 0)\n            break;\n        if (pkey->type == v) {\n            ok = 1;\n            break;\n        }\n    }\n    if (!ok) {\n        EVPerr(EVP_F_EVP_SIGNFINAL, EVP_R_WRONG_PUBLIC_KEY_TYPE);\n        return (0);\n    }\n    if (ctx->digest->sign == NULL) {\n        EVPerr(EVP_F_EVP_SIGNFINAL, EVP_R_NO_SIGN_FUNCTION_CONFIGURED);\n        return (0);\n    }\n    return ctx->digest->sign(ctx->digest->type, m, m_len, sigret, siglen,\n                             pkey->pkey.ptr);\n}']