crypto/pkcs7/pk7_smime.c:584: error: UNINITIALIZED_VALUE
  The value read from ret was never initialized.
Showing all 1 steps of the trace


crypto/pkcs7/pk7_smime.c:584:9: 
582.           }
583.           BIO_free_all(tmpmem);
584. >         return ret;
585.       }
586.   }

int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags)
{
    BIO *tmpmem;
    int ret, i;
    char buf[4096];
    if (!p7) {
        PKCS7err(PKCS7_F_PKCS7_DECRYPT, PKCS7_R_INVALID_NULL_POINTER);
        return 0;
    }
    if (!PKCS7_type_is_enveloped(p7)) {
        PKCS7err(PKCS7_F_PKCS7_DECRYPT, PKCS7_R_WRONG_CONTENT_TYPE);
        return 0;
    }
    if (cert && !X509_check_private_key(cert, pkey)) {
        PKCS7err(PKCS7_F_PKCS7_DECRYPT,
                 PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE);
        return 0;
    }
    if (!(tmpmem = PKCS7_dataDecode(p7, pkey, NULL, cert))) {
        PKCS7err(PKCS7_F_PKCS7_DECRYPT, PKCS7_R_DECRYPT_ERROR);
        return 0;
    }
    if (flags & PKCS7_TEXT) {
        BIO *tmpbuf, *bread;
        if (!(tmpbuf = BIO_new(BIO_f_buffer()))) {
            PKCS7err(PKCS7_F_PKCS7_DECRYPT, ERR_R_MALLOC_FAILURE);
            BIO_free_all(tmpmem);
            return 0;
        }
        if (!(bread = BIO_push(tmpbuf, tmpmem))) {
            PKCS7err(PKCS7_F_PKCS7_DECRYPT, ERR_R_MALLOC_FAILURE);
            BIO_free_all(tmpbuf);
            BIO_free_all(tmpmem);
            return 0;
        }
        ret = SMIME_text(bread, data);
        if (ret > 0 && BIO_method_type(tmpmem) == BIO_TYPE_CIPHER) {
            if (!BIO_get_cipher_status(tmpmem))
                ret = 0;
        }
        BIO_free_all(bread);
        return ret;
    } else {
        for (;;) {
            i = BIO_read(tmpmem, buf, sizeof(buf));
            if (i <= 0) {
                ret = 1;
                if (BIO_method_type(tmpmem) == BIO_TYPE_CIPHER) {
                    if (!BIO_get_cipher_status(tmpmem))
                        ret = 0;
                }
                break;
            }
            if (BIO_write(data, buf, i) != i) {
                ret = 0;
                break;
            }
        }
        BIO_free_all(tmpmem);
        return ret;
    }
}
['int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags)\n{\n    BIO *tmpmem;\n    int ret, i;\n    char buf[4096];\n    if (!p7) {\n        PKCS7err(PKCS7_F_PKCS7_DECRYPT, PKCS7_R_INVALID_NULL_POINTER);\n        return 0;\n    }\n    if (!PKCS7_type_is_enveloped(p7)) {\n        PKCS7err(PKCS7_F_PKCS7_DECRYPT, PKCS7_R_WRONG_CONTENT_TYPE);\n        return 0;\n    }\n    if (cert && !X509_check_private_key(cert, pkey)) {\n        PKCS7err(PKCS7_F_PKCS7_DECRYPT,\n                 PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE);\n        return 0;\n    }\n    if (!(tmpmem = PKCS7_dataDecode(p7, pkey, NULL, cert))) {\n        PKCS7err(PKCS7_F_PKCS7_DECRYPT, PKCS7_R_DECRYPT_ERROR);\n        return 0;\n    }\n    if (flags & PKCS7_TEXT) {\n        BIO *tmpbuf, *bread;\n        if (!(tmpbuf = BIO_new(BIO_f_buffer()))) {\n            PKCS7err(PKCS7_F_PKCS7_DECRYPT, ERR_R_MALLOC_FAILURE);\n            BIO_free_all(tmpmem);\n            return 0;\n        }\n        if (!(bread = BIO_push(tmpbuf, tmpmem))) {\n            PKCS7err(PKCS7_F_PKCS7_DECRYPT, ERR_R_MALLOC_FAILURE);\n            BIO_free_all(tmpbuf);\n            BIO_free_all(tmpmem);\n            return 0;\n        }\n        ret = SMIME_text(bread, data);\n        if (ret > 0 && BIO_method_type(tmpmem) == BIO_TYPE_CIPHER) {\n            if (!BIO_get_cipher_status(tmpmem))\n                ret = 0;\n        }\n        BIO_free_all(bread);\n        return ret;\n    } else {\n        for (;;) {\n            i = BIO_read(tmpmem, buf, sizeof(buf));\n            if (i <= 0) {\n                ret = 1;\n                if (BIO_method_type(tmpmem) == BIO_TYPE_CIPHER) {\n                    if (!BIO_get_cipher_status(tmpmem))\n                        ret = 0;\n                }\n                break;\n            }\n            if (BIO_write(data, buf, i) != i) {\n                ret = 0;\n                break;\n            }\n        }\n        BIO_free_all(tmpmem);\n        return ret;\n    }\n}']