apps/s_server.c:1627: error: BUFFER_OVERRUN_L3
  Offset: [1, 65535] Size: [1, +oo] by call to `next_protos_parse`.
Showing all 17 steps of the trace


apps/s_server.c:1594:18: Call
1592.           }
1593.   
1594.           s_cert = load_cert(s_cert_file, s_cert_format,
                         ^
1595.                              "server certificate file");
1596.   

apps/apps.c:699:9: Call
  697.       if (format == FORMAT_HTTP) {
  698.   #ifndef OPENSSL_NO_OCSP
  699.           load_cert_crl_http(file, &x, NULL);
                 ^
  700.   #endif
  701.           return x;

apps/apps.c:650:10: Call
    648.       OCSP_REQ_CTX *rctx = NULL;
    649.       int use_ssl, rv = 0;
    650.       if (!OCSP_parse_url(url, &host, &port, &path, &use_ssl))
                    ^
    651.           goto err;
    652.       if (use_ssl) {

crypto/ocsp/ocsp_lib.c:195:5: Assignment
      193.           goto parse_err;
      194.   
      195.       *(p++) = '\0';
                 ^
      196.   
      197.       if (strcmp(buf, "http") == 0) {

apps/s_server.c:1627:27: Call
1625.       if (next_proto_neg_in) {
1626.           size_t len;
1627.           next_proto.data = next_protos_parse(&len, next_proto_neg_in);
                                  ^
1628.           if (next_proto.data == NULL)
1629.               goto end;

apps/apps.c:1974:10: <Offset trace>
1972.   
1973.       out = app_malloc(strlen(in) + 1, "NPN buffer");
1974.       for (i = 0; i <= len; ++i) {
                 ^
1975.           if (i == len || in[i] == ',') {
1976.               if (i - start > 255) {

apps/apps.c:1974:10: Assignment
  1972.   
  1973.       out = app_malloc(strlen(in) + 1, "NPN buffer");
  1974.       for (i = 0; i <= len; ++i) {
                   ^
  1975.           if (i == len || in[i] == ',') {
  1976.               if (i - start > 255) {

apps/apps.c:1963:1: <Length trace>
1961.    *   returns: a malloced buffer or NULL on failure.
1962.    */
1963. > unsigned char *next_protos_parse(size_t *outlen, const char *in)
1964.   {
1965.       size_t len;

apps/apps.c:1963:1: Parameter `in->strlen`
  1961.    *   returns: a malloced buffer or NULL on failure.
  1962.    */
  1963. > unsigned char *next_protos_parse(size_t *outlen, const char *in)
  1964.   {
  1965.       size_t len;

apps/apps.c:1973:11: Call
  1971.           return NULL;
  1972.   
  1973.       out = app_malloc(strlen(in) + 1, "NPN buffer");
                    ^
  1974.       for (i = 0; i <= len; ++i) {
  1975.           if (i == len || in[i] == ',') {

apps/apps.c:1006:1: Parameter `sz`
    1004.   }
    1005.   
    1006. > void* app_malloc(int sz, const char *what)
    1007.   {
    1008.       void *vp = OPENSSL_malloc(sz);

apps/apps.c:1008:16: Call
    1006.   void* app_malloc(int sz, const char *what)
    1007.   {
    1008.       void *vp = OPENSSL_malloc(sz);
                           ^
    1009.   
    1010.       if (vp == NULL) {

crypto/mem.c:127:9: Assignment
      125.   
      126.       if (num <= 0)
      127.           return NULL;
                     ^
      128.   
      129.       allow_customize = 0;

apps/apps.c:1008:5: Assignment
    1006.   void* app_malloc(int sz, const char *what)
    1007.   {
    1008.       void *vp = OPENSSL_malloc(sz);
                ^
    1009.   
    1010.       if (vp == NULL) {

apps/apps.c:1016:5: Assignment
    1014.           exit(1);
    1015.       }
    1016.       return vp;
                ^
    1017.   }
    1018.   

apps/apps.c:1973:5: Assignment
  1971.           return NULL;
  1972.   
  1973.       out = app_malloc(strlen(in) + 1, "NPN buffer");
              ^
  1974.       for (i = 0; i <= len; ++i) {
  1975.           if (i == len || in[i] == ',') {

apps/apps.c:1983:13: Array access: Offset: [1, 65535] Size: [1, +oo] by call to `next_protos_parse` 
  1981.               start = i + 1;
  1982.           } else
  1983.               out[i + 1] = in[i];
                      ^
  1984.       }
  1985.   

unsigned char *next_protos_parse(size_t *outlen, const char *in)
{
    size_t len;
    unsigned char *out;
    size_t i, start = 0;
    len = strlen(in);
    if (len >= 65535)
        return NULL;
    out = app_malloc(strlen(in) + 1, "NPN buffer");
    for (i = 0; i <= len; ++i) {
        if (i == len || in[i] == ',') {
            if (i - start > 255) {
                OPENSSL_free(out);
                return NULL;
            }
            out[start] = i - start;
            start = i + 1;
        } else
            out[i + 1] = in[i];
    }
    *outlen = len + 1;
    return out;
}
['int s_server_main(int argc, char *argv[])\n{\n    ENGINE *e = NULL;\n    EVP_PKEY *s_key = NULL, *s_dkey = NULL;\n    SSL_CONF_CTX *cctx = NULL;\n    const SSL_METHOD *meth = TLS_server_method();\n    SSL_EXCERT *exc = NULL;\n    STACK_OF(OPENSSL_STRING) *ssl_args = NULL;\n    STACK_OF(X509) *s_chain = NULL, *s_dchain = NULL;\n    STACK_OF(X509_CRL) *crls = NULL;\n    X509 *s_cert = NULL, *s_dcert = NULL;\n    X509_VERIFY_PARAM *vpm = NULL;\n    char *CApath = NULL, *CAfile = NULL, *chCApath = NULL, *chCAfile = NULL;\n#ifndef OPENSSL_NO_DH\n    char *dhfile = NULL;\n#endif\n    char *dpassarg = NULL, *dpass = NULL, *inrand = NULL;\n    char *passarg = NULL, *pass = NULL, *vfyCApath = NULL, *vfyCAfile = NULL;\n    char *crl_file = NULL, *prog;\n#ifndef OPENSSL_NO_PSK\n    char *p;\n#endif\n#ifdef AF_UNIX\n    int unlink_unix_path = 0;\n#endif\n    do_server_cb server_cb;\n    int vpmtouched = 0, build_chain = 0, no_cache = 0, ext_cache = 0;\n#ifndef OPENSSL_NO_DH\n    int no_dhe = 0;\n#endif\n    int nocert = 0, ret = 1;\n    int noCApath = 0, noCAfile = 0;\n    int s_cert_format = FORMAT_PEM, s_key_format = FORMAT_PEM;\n    int s_dcert_format = FORMAT_PEM, s_dkey_format = FORMAT_PEM;\n    int rev = 0, naccept = -1, sdebug = 0;\n    int socket_family = AF_UNSPEC, socket_type = SOCK_STREAM;\n    int state = 0, crl_format = FORMAT_PEM, crl_download = 0;\n    char *host = NULL;\n    char *port = BUF_strdup(PORT);\n    unsigned char *context = NULL;\n    OPTION_CHOICE o;\n    EVP_PKEY *s_key2 = NULL;\n    X509 *s_cert2 = NULL;\n    tlsextctx tlsextcbp = { NULL, NULL, SSL_TLSEXT_ERR_ALERT_WARNING };\n    const char *ssl_config = NULL;\n    int read_buf_len = 0;\n#ifndef OPENSSL_NO_NEXTPROTONEG\n    const char *next_proto_neg_in = NULL;\n    tlsextnextprotoctx next_proto = { NULL, 0 };\n#endif\n    const char *alpn_in = NULL;\n    tlsextalpnctx alpn_ctx = { NULL, 0 };\n#ifndef OPENSSL_NO_PSK\n    static char *psk_identity_hint = NULL;\n#endif\n#ifndef OPENSSL_NO_SRP\n    char *srpuserseed = NULL;\n    char *srp_verifier_file = NULL;\n#endif\n    int min_version = 0, max_version = 0;\n    local_argc = argc;\n    local_argv = argv;\n    s_server_init();\n    cctx = SSL_CONF_CTX_new();\n    vpm = X509_VERIFY_PARAM_new();\n    if (cctx == NULL || vpm == NULL)\n        goto end;\n    SSL_CONF_CTX_set_flags(cctx, SSL_CONF_FLAG_SERVER | SSL_CONF_FLAG_CMDLINE);\n    prog = opt_init(argc, argv, s_server_options);\n    while ((o = opt_next()) != OPT_EOF) {\n        switch (o) {\n        case OPT_EOF:\n        case OPT_ERR:\n opthelp:\n            BIO_printf(bio_err, "%s: Use -help for summary.\\n", prog);\n            goto end;\n        case OPT_HELP:\n            opt_help(s_server_options);\n            ret = 0;\n            goto end;\n        case OPT_4:\n#ifdef AF_UNIX\n            if (socket_family == AF_UNIX) {\n                OPENSSL_free(host); host = NULL;\n                OPENSSL_free(port); port = NULL;\n            }\n#endif\n            socket_family = AF_INET;\n            break;\n        case OPT_6:\n            if (1) {\n#ifdef AF_INET6\n#ifdef AF_UNIX\n                if (socket_family == AF_UNIX) {\n                    OPENSSL_free(host); host = NULL;\n                    OPENSSL_free(port); port = NULL;\n                }\n#endif\n                socket_family = AF_INET6;\n            } else {\n#endif\n                BIO_printf(bio_err, "%s: IPv6 domain sockets unsupported\\n", prog);\n                goto end;\n            }\n            break;\n        case OPT_PORT:\n#ifdef AF_UNIX\n            if (socket_family == AF_UNIX) {\n                socket_family = AF_UNSPEC;\n            }\n#endif\n            OPENSSL_free(port); port = NULL;\n            OPENSSL_free(host); host = NULL;\n            if (BIO_parse_hostserv(opt_arg(), NULL, &port, BIO_PARSE_PRIO_SERV) < 1) {\n                BIO_printf(bio_err,\n                           "%s: -port argument malformed or ambiguous\\n",\n                           port);\n                goto end;\n            }\n            break;\n        case OPT_ACCEPT:\n#ifdef AF_UNIX\n            if (socket_family == AF_UNIX) {\n                socket_family = AF_UNSPEC;\n            }\n#endif\n            OPENSSL_free(port); port = NULL;\n            OPENSSL_free(host); host = NULL;\n            if (BIO_parse_hostserv(opt_arg(), &host, &port, BIO_PARSE_PRIO_SERV) < 1) {\n                BIO_printf(bio_err,\n                           "%s: -accept argument malformed or ambiguous\\n",\n                           port);\n                goto end;\n            }\n            break;\n#ifdef AF_UNIX\n        case OPT_UNIX:\n            socket_family = AF_UNIX;\n            OPENSSL_free(host); host = BUF_strdup(opt_arg());\n            OPENSSL_free(port); port = NULL;\n            break;\n        case OPT_UNLINK:\n            unlink_unix_path = 1;\n            break;\n#endif\n        case OPT_NACCEPT:\n            naccept = atol(opt_arg());\n            break;\n        case OPT_VERIFY:\n            s_server_verify = SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE;\n            verify_depth = atoi(opt_arg());\n            if (!s_quiet)\n                BIO_printf(bio_err, "verify depth is %d\\n", verify_depth);\n            break;\n        case OPT_UPPER_V_VERIFY:\n            s_server_verify =\n                SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT |\n                SSL_VERIFY_CLIENT_ONCE;\n            verify_depth = atoi(opt_arg());\n            if (!s_quiet)\n                BIO_printf(bio_err,\n                           "verify depth is %d, must return a certificate\\n",\n                           verify_depth);\n            break;\n        case OPT_CONTEXT:\n            context = (unsigned char *)opt_arg();\n            break;\n        case OPT_CERT:\n            s_cert_file = opt_arg();\n            break;\n        case OPT_CRL:\n            crl_file = opt_arg();\n            break;\n        case OPT_CRL_DOWNLOAD:\n            crl_download = 1;\n            break;\n        case OPT_SERVERINFO:\n            s_serverinfo_file = opt_arg();\n            break;\n        case OPT_CERTFORM:\n            if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &s_cert_format))\n                goto opthelp;\n            break;\n        case OPT_KEY:\n            s_key_file = opt_arg();\n            break;\n        case OPT_KEYFORM:\n            if (!opt_format(opt_arg(), OPT_FMT_ANY, &s_key_format))\n                goto opthelp;\n            break;\n        case OPT_PASS:\n            passarg = opt_arg();\n            break;\n        case OPT_CERT_CHAIN:\n            s_chain_file = opt_arg();\n            break;\n        case OPT_DHPARAM:\n#ifndef OPENSSL_NO_DH\n            dhfile = opt_arg();\n#endif\n            break;\n        case OPT_DCERTFORM:\n            if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &s_dcert_format))\n                goto opthelp;\n            break;\n        case OPT_DCERT:\n            s_dcert_file = opt_arg();\n            break;\n        case OPT_DKEYFORM:\n            if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &s_dkey_format))\n                goto opthelp;\n            break;\n        case OPT_DPASS:\n            dpassarg = opt_arg();\n            break;\n        case OPT_DKEY:\n            s_dkey_file = opt_arg();\n            break;\n        case OPT_DCERT_CHAIN:\n            s_dchain_file = opt_arg();\n            break;\n        case OPT_NOCERT:\n            nocert = 1;\n            break;\n        case OPT_CAPATH:\n            CApath = opt_arg();\n            break;\n        case OPT_NOCAPATH:\n            noCApath = 1;\n            break;\n        case OPT_CHAINCAPATH:\n            chCApath = opt_arg();\n            break;\n        case OPT_VERIFYCAPATH:\n            vfyCApath = opt_arg();\n            break;\n        case OPT_NO_CACHE:\n            no_cache = 1;\n            break;\n        case OPT_EXT_CACHE:\n            ext_cache = 1;\n            break;\n        case OPT_CRLFORM:\n            if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &crl_format))\n                goto opthelp;\n            break;\n        case OPT_S_CASES:\n            if (ssl_args == NULL)\n                ssl_args = sk_OPENSSL_STRING_new_null();\n            if (ssl_args == NULL\n                || !sk_OPENSSL_STRING_push(ssl_args, opt_flag())\n                || !sk_OPENSSL_STRING_push(ssl_args, opt_arg())) {\n                BIO_printf(bio_err, "%s: Memory allocation failure\\n", prog);\n                goto end;\n            }\n            break;\n        case OPT_V_CASES:\n            if (!opt_verify(o, vpm))\n                goto end;\n            vpmtouched++;\n            break;\n        case OPT_X_CASES:\n            if (!args_excert(o, &exc))\n                goto end;\n            break;\n        case OPT_VERIFY_RET_ERROR:\n            verify_return_error = 1;\n            break;\n        case OPT_VERIFY_QUIET:\n            verify_quiet = 1;\n            break;\n        case OPT_BUILD_CHAIN:\n            build_chain = 1;\n            break;\n        case OPT_CAFILE:\n            CAfile = opt_arg();\n            break;\n        case OPT_NOCAFILE:\n            noCAfile = 1;\n            break;\n        case OPT_CHAINCAFILE:\n            chCAfile = opt_arg();\n            break;\n        case OPT_VERIFYCAFILE:\n            vfyCAfile = opt_arg();\n            break;\n        case OPT_NBIO:\n            s_nbio = 1;\n            break;\n        case OPT_NBIO_TEST:\n            s_nbio = s_nbio_test = 1;\n            break;\n        case OPT_IGN_EOF:\n            s_ign_eof = 1;\n            break;\n        case OPT_NO_IGN_EOF:\n            s_ign_eof = 0;\n            break;\n        case OPT_DEBUG:\n            s_debug = 1;\n            break;\n        case OPT_TLSEXTDEBUG:\n            s_tlsextdebug = 1;\n            break;\n        case OPT_STATUS:\n            s_tlsextstatus = 1;\n            break;\n        case OPT_STATUS_VERBOSE:\n            s_tlsextstatus = tlscstatp.verbose = 1;\n            break;\n        case OPT_STATUS_TIMEOUT:\n            s_tlsextstatus = 1;\n            tlscstatp.timeout = atoi(opt_arg());\n            break;\n        case OPT_STATUS_URL:\n            s_tlsextstatus = 1;\n            if (!OCSP_parse_url(opt_arg(),\n                                &tlscstatp.host,\n                                &tlscstatp.port,\n                                &tlscstatp.path, &tlscstatp.use_ssl)) {\n                BIO_printf(bio_err, "Error parsing URL\\n");\n                goto end;\n            }\n            break;\n        case OPT_MSG:\n            s_msg = 1;\n            break;\n        case OPT_MSGFILE:\n            bio_s_msg = BIO_new_file(opt_arg(), "w");\n            break;\n        case OPT_TRACE:\n#ifndef OPENSSL_NO_SSL_TRACE\n            s_msg = 2;\n#endif\n            break;\n        case OPT_SECURITY_DEBUG:\n            sdebug = 1;\n            break;\n        case OPT_SECURITY_DEBUG_VERBOSE:\n            sdebug = 2;\n            break;\n        case OPT_STATE:\n            state = 1;\n            break;\n        case OPT_CRLF:\n            s_crlf = 1;\n            break;\n        case OPT_QUIET:\n            s_quiet = 1;\n            break;\n        case OPT_BRIEF:\n            s_quiet = s_brief = verify_quiet = 1;\n            break;\n        case OPT_NO_DHE:\n#ifndef OPENSSL_NO_DH\n            no_dhe = 1;\n#endif\n            break;\n        case OPT_NO_RESUME_EPHEMERAL:\n            no_resume_ephemeral = 1;\n            break;\n        case OPT_PSK_HINT:\n#ifndef OPENSSL_NO_PSK\n            psk_identity_hint = opt_arg();\n#endif\n            break;\n        case OPT_PSK:\n#ifndef OPENSSL_NO_PSK\n            for (p = psk_key = opt_arg(); *p; p++) {\n                if (isxdigit(_UC(*p)))\n                    continue;\n                BIO_printf(bio_err, "Not a hex number \'%s\'\\n", *argv);\n                goto end;\n            }\n#endif\n            break;\n        case OPT_SRPVFILE:\n#ifndef OPENSSL_NO_SRP\n            srp_verifier_file = opt_arg();\n            if (min_version < TLS1_VERSION)\n                min_version = TLS1_VERSION;\n#endif\n            break;\n        case OPT_SRPUSERSEED:\n#ifndef OPENSSL_NO_SRP\n            srpuserseed = opt_arg();\n            if (min_version < TLS1_VERSION)\n                min_version = TLS1_VERSION;\n#endif\n            break;\n        case OPT_REV:\n            rev = 1;\n            break;\n        case OPT_WWW:\n            www = 1;\n            break;\n        case OPT_UPPER_WWW:\n            www = 2;\n            break;\n        case OPT_HTTP:\n            www = 3;\n            break;\n        case OPT_SSL_CONFIG:\n            ssl_config = opt_arg();\n            break;\n        case OPT_SSL3:\n            min_version = SSL3_VERSION;\n            max_version = SSL3_VERSION;\n            break;\n        case OPT_TLS1_2:\n            min_version = TLS1_2_VERSION;\n            max_version = TLS1_2_VERSION;\n            break;\n        case OPT_TLS1_1:\n            min_version = TLS1_1_VERSION;\n            max_version = TLS1_1_VERSION;\n            break;\n        case OPT_TLS1:\n            min_version = TLS1_VERSION;\n            max_version = TLS1_VERSION;\n            break;\n        case OPT_DTLS:\n#ifndef OPENSSL_NO_DTLS\n            meth = DTLS_server_method();\n            socket_type = SOCK_DGRAM;\n#endif\n            break;\n        case OPT_DTLS1:\n#ifndef OPENSSL_NO_DTLS\n            meth = DTLS_server_method();\n            min_version = DTLS1_VERSION;\n            max_version = DTLS1_VERSION;\n            socket_type = SOCK_DGRAM;\n#endif\n            break;\n        case OPT_DTLS1_2:\n#ifndef OPENSSL_NO_DTLS\n            meth = DTLS_server_method();\n            min_version = DTLS1_2_VERSION;\n            max_version = DTLS1_2_VERSION;\n            socket_type = SOCK_DGRAM;\n#endif\n            break;\n        case OPT_TIMEOUT:\n#ifndef OPENSSL_NO_DTLS\n            enable_timeouts = 1;\n#endif\n            break;\n        case OPT_MTU:\n#ifndef OPENSSL_NO_DTLS\n            socket_mtu = atol(opt_arg());\n#endif\n            break;\n        case OPT_CHAIN:\n#ifndef OPENSSL_NO_DTLS\n            cert_chain = 1;\n#endif\n            break;\n        case OPT_LISTEN:\n#ifndef OPENSSL_NO_DTLS\n            dtlslisten = 1;\n#endif\n            break;\n        case OPT_ID_PREFIX:\n            session_id_prefix = opt_arg();\n            break;\n        case OPT_ENGINE:\n            e = setup_engine(opt_arg(), 1);\n            break;\n        case OPT_RAND:\n            inrand = opt_arg();\n            break;\n        case OPT_SERVERNAME:\n            tlsextcbp.servername = opt_arg();\n            break;\n        case OPT_SERVERNAME_FATAL:\n            tlsextcbp.extension_error = SSL_TLSEXT_ERR_ALERT_FATAL;\n            break;\n        case OPT_CERT2:\n            s_cert_file2 = opt_arg();\n            break;\n        case OPT_KEY2:\n            s_key_file2 = opt_arg();\n            break;\n        case OPT_NEXTPROTONEG:\n# ifndef OPENSSL_NO_NEXTPROTONEG\n            next_proto_neg_in = opt_arg();\n#endif\n            break;\n        case OPT_ALPN:\n            alpn_in = opt_arg();\n            break;\n        case OPT_SRTP_PROFILES:\n#ifndef OPENSSL_NO_SRTP\n            srtp_profiles = opt_arg();\n#endif\n            break;\n        case OPT_KEYMATEXPORT:\n            keymatexportlabel = opt_arg();\n            break;\n        case OPT_KEYMATEXPORTLEN:\n            keymatexportlen = atoi(opt_arg());\n            break;\n        case OPT_ASYNC:\n            async = 1;\n            break;\n        case OPT_SPLIT_SEND_FRAG:\n            split_send_fragment = atoi(opt_arg());\n            if (split_send_fragment == 0) {\n                split_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH + 1;\n            }\n            break;\n        case OPT_MAX_PIPELINES:\n            max_pipelines = atoi(opt_arg());\n            break;\n        case OPT_READ_BUF:\n            read_buf_len = atoi(opt_arg());\n            break;\n        }\n    }\n    argc = opt_num_rest();\n    argv = opt_rest();\n#ifndef OPENSSL_NO_DTLS\n    if (www && socket_type == SOCK_DGRAM) {\n        BIO_printf(bio_err, "Can\'t use -HTTP, -www or -WWW with DTLS\\n");\n        goto end;\n    }\n    if (dtlslisten && socket_type != SOCK_DGRAM) {\n        BIO_printf(bio_err, "Can only use -listen with DTLS\\n");\n        goto end;\n    }\n#endif\n#ifdef AF_UNIX\n    if (socket_family == AF_UNIX && socket_type != SOCK_STREAM) {\n        BIO_printf(bio_err,\n                   "Can\'t use unix sockets and datagrams together\\n");\n        goto end;\n    }\n#endif\n    if (split_send_fragment > SSL3_RT_MAX_PLAIN_LENGTH) {\n        BIO_printf(bio_err, "Bad split send fragment size\\n");\n        goto end;\n    }\n    if (max_pipelines > SSL_MAX_PIPELINES) {\n        BIO_printf(bio_err, "Bad max pipelines value\\n");\n        goto end;\n    }\n    if (!app_passwd(passarg, dpassarg, &pass, &dpass)) {\n        BIO_printf(bio_err, "Error getting password\\n");\n        goto end;\n    }\n    if (s_key_file == NULL)\n        s_key_file = s_cert_file;\n    if (s_key_file2 == NULL)\n        s_key_file2 = s_cert_file2;\n    if (!load_excert(&exc))\n        goto end;\n    if (nocert == 0) {\n        s_key = load_key(s_key_file, s_key_format, 0, pass, e,\n                         "server certificate private key file");\n        if (!s_key) {\n            ERR_print_errors(bio_err);\n            goto end;\n        }\n        s_cert = load_cert(s_cert_file, s_cert_format,\n                           "server certificate file");\n        if (!s_cert) {\n            ERR_print_errors(bio_err);\n            goto end;\n        }\n        if (s_chain_file) {\n            if (!load_certs(s_chain_file, &s_chain, FORMAT_PEM, NULL,\n                            "server certificate chain"))\n                goto end;\n        }\n        if (tlsextcbp.servername) {\n            s_key2 = load_key(s_key_file2, s_key_format, 0, pass, e,\n                              "second server certificate private key file");\n            if (!s_key2) {\n                ERR_print_errors(bio_err);\n                goto end;\n            }\n            s_cert2 = load_cert(s_cert_file2, s_cert_format,\n                                "second server certificate file");\n            if (!s_cert2) {\n                ERR_print_errors(bio_err);\n                goto end;\n            }\n        }\n    }\n#if !defined(OPENSSL_NO_NEXTPROTONEG)\n    if (next_proto_neg_in) {\n        size_t len;\n        next_proto.data = next_protos_parse(&len, next_proto_neg_in);\n        if (next_proto.data == NULL)\n            goto end;\n        next_proto.len = len;\n    } else {\n        next_proto.data = NULL;\n    }\n#endif\n    alpn_ctx.data = NULL;\n    if (alpn_in) {\n        size_t len;\n        alpn_ctx.data = next_protos_parse(&len, alpn_in);\n        if (alpn_ctx.data == NULL)\n            goto end;\n        alpn_ctx.len = len;\n    }\n    if (crl_file) {\n        X509_CRL *crl;\n        crl = load_crl(crl_file, crl_format);\n        if (!crl) {\n            BIO_puts(bio_err, "Error loading CRL\\n");\n            ERR_print_errors(bio_err);\n            goto end;\n        }\n        crls = sk_X509_CRL_new_null();\n        if (!crls || !sk_X509_CRL_push(crls, crl)) {\n            BIO_puts(bio_err, "Error adding CRL\\n");\n            ERR_print_errors(bio_err);\n            X509_CRL_free(crl);\n            goto end;\n        }\n    }\n    if (s_dcert_file) {\n        if (s_dkey_file == NULL)\n            s_dkey_file = s_dcert_file;\n        s_dkey = load_key(s_dkey_file, s_dkey_format,\n                          0, dpass, e, "second certificate private key file");\n        if (!s_dkey) {\n            ERR_print_errors(bio_err);\n            goto end;\n        }\n        s_dcert = load_cert(s_dcert_file, s_dcert_format,\n                            "second server certificate file");\n        if (!s_dcert) {\n            ERR_print_errors(bio_err);\n            goto end;\n        }\n        if (s_dchain_file) {\n            if (!load_certs(s_dchain_file, &s_dchain, FORMAT_PEM, NULL,\n                            "second server certificate chain"))\n                goto end;\n        }\n    }\n    if (!app_RAND_load_file(NULL, 1) && inrand == NULL\n        && !RAND_status()) {\n        BIO_printf(bio_err,\n                   "warning, not much extra random data, consider using the -rand option\\n");\n    }\n    if (inrand != NULL)\n        BIO_printf(bio_err, "%ld semi-random bytes loaded\\n",\n                   app_RAND_load_files(inrand));\n    if (bio_s_out == NULL) {\n        if (s_quiet && !s_debug) {\n            bio_s_out = BIO_new(BIO_s_null());\n            if (s_msg && !bio_s_msg)\n                bio_s_msg = dup_bio_out(FORMAT_TEXT);\n        } else {\n            if (bio_s_out == NULL)\n                bio_s_out = dup_bio_out(FORMAT_TEXT);\n        }\n    }\n#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_EC)\n    if (nocert)\n#endif\n    {\n        s_cert_file = NULL;\n        s_key_file = NULL;\n        s_dcert_file = NULL;\n        s_dkey_file = NULL;\n        s_cert_file2 = NULL;\n        s_key_file2 = NULL;\n    }\n    ctx = SSL_CTX_new(meth);\n    if (ctx == NULL) {\n        ERR_print_errors(bio_err);\n        goto end;\n    }\n    if (sdebug)\n        ssl_ctx_security_debug(ctx, sdebug);\n    if (ssl_config) {\n        if (SSL_CTX_config(ctx, ssl_config) == 0) {\n            BIO_printf(bio_err, "Error using configuration \\"%s\\"\\n",\n                       ssl_config);\n        ERR_print_errors(bio_err);\n        goto end;\n        }\n    }\n    if (SSL_CTX_set_min_proto_version(ctx, min_version) == 0)\n        goto end;\n    if (SSL_CTX_set_max_proto_version(ctx, max_version) == 0)\n        goto end;\n    if (session_id_prefix) {\n        if (strlen(session_id_prefix) >= 32)\n            BIO_printf(bio_err,\n                       "warning: id_prefix is too long, only one new session will be possible\\n");\n        if (!SSL_CTX_set_generate_session_id(ctx, generate_session_id)) {\n            BIO_printf(bio_err, "error setting \'id_prefix\'\\n");\n            ERR_print_errors(bio_err);\n            goto end;\n        }\n        BIO_printf(bio_err, "id_prefix \'%s\' set.\\n", session_id_prefix);\n    }\n    SSL_CTX_set_quiet_shutdown(ctx, 1);\n    if (exc)\n        ssl_ctx_set_excert(ctx, exc);\n    if (state)\n        SSL_CTX_set_info_callback(ctx, apps_ssl_info_callback);\n    if (no_cache)\n        SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);\n    else if (ext_cache)\n        init_session_cache_ctx(ctx);\n    else\n        SSL_CTX_sess_set_cache_size(ctx, 128);\n    if (async) {\n        SSL_CTX_set_mode(ctx, SSL_MODE_ASYNC);\n    }\n    if (split_send_fragment > 0) {\n        SSL_CTX_set_split_send_fragment(ctx, split_send_fragment);\n    }\n    if (max_pipelines > 0) {\n        SSL_CTX_set_max_pipelines(ctx, max_pipelines);\n    }\n    if (read_buf_len > 0) {\n        SSL_CTX_set_default_read_buffer_len(ctx, read_buf_len);\n    }\n#ifndef OPENSSL_NO_SRTP\n    if (srtp_profiles != NULL) {\n        if (SSL_CTX_set_tlsext_use_srtp(ctx, srtp_profiles) != 0) {\n            BIO_printf(bio_err, "Error setting SRTP profile\\n");\n            ERR_print_errors(bio_err);\n            goto end;\n        }\n    }\n#endif\n    if (!ctx_set_verify_locations(ctx, CAfile, CApath, noCAfile, noCApath)) {\n        ERR_print_errors(bio_err);\n        goto end;\n    }\n    if (vpmtouched && !SSL_CTX_set1_param(ctx, vpm)) {\n        BIO_printf(bio_err, "Error setting verify params\\n");\n        ERR_print_errors(bio_err);\n        goto end;\n    }\n    ssl_ctx_add_crls(ctx, crls, 0);\n    if (!config_ctx(cctx, ssl_args, ctx))\n        goto end;\n    if (!ssl_load_stores(ctx, vfyCApath, vfyCAfile, chCApath, chCAfile,\n                         crls, crl_download)) {\n        BIO_printf(bio_err, "Error loading store locations\\n");\n        ERR_print_errors(bio_err);\n        goto end;\n    }\n    if (s_cert2) {\n        ctx2 = SSL_CTX_new(meth);\n        if (ctx2 == NULL) {\n            ERR_print_errors(bio_err);\n            goto end;\n        }\n    }\n    if (ctx2) {\n        BIO_printf(bio_s_out, "Setting secondary ctx parameters\\n");\n        if (sdebug)\n            ssl_ctx_security_debug(ctx, sdebug);\n        if (session_id_prefix) {\n            if (strlen(session_id_prefix) >= 32)\n                BIO_printf(bio_err,\n                           "warning: id_prefix is too long, only one new session will be possible\\n");\n            if (!SSL_CTX_set_generate_session_id(ctx2, generate_session_id)) {\n                BIO_printf(bio_err, "error setting \'id_prefix\'\\n");\n                ERR_print_errors(bio_err);\n                goto end;\n            }\n            BIO_printf(bio_err, "id_prefix \'%s\' set.\\n", session_id_prefix);\n        }\n        SSL_CTX_set_quiet_shutdown(ctx2, 1);\n        if (exc)\n            ssl_ctx_set_excert(ctx2, exc);\n        if (state)\n            SSL_CTX_set_info_callback(ctx2, apps_ssl_info_callback);\n        if (no_cache)\n            SSL_CTX_set_session_cache_mode(ctx2, SSL_SESS_CACHE_OFF);\n        else if (ext_cache)\n            init_session_cache_ctx(ctx2);\n        else\n            SSL_CTX_sess_set_cache_size(ctx2, 128);\n        if (async)\n            SSL_CTX_set_mode(ctx2, SSL_MODE_ASYNC);\n        if ((!SSL_CTX_load_verify_locations(ctx2, CAfile, CApath)) ||\n            (!SSL_CTX_set_default_verify_paths(ctx2))) {\n            ERR_print_errors(bio_err);\n        }\n        if (vpmtouched && !SSL_CTX_set1_param(ctx2, vpm)) {\n            BIO_printf(bio_err, "Error setting verify params\\n");\n            ERR_print_errors(bio_err);\n            goto end;\n        }\n        ssl_ctx_add_crls(ctx2, crls, 0);\n        if (!config_ctx(cctx, ssl_args, ctx2))\n            goto end;\n    }\n#ifndef OPENSSL_NO_NEXTPROTONEG\n    if (next_proto.data)\n        SSL_CTX_set_next_protos_advertised_cb(ctx, next_proto_cb,\n                                              &next_proto);\n#endif\n    if (alpn_ctx.data)\n        SSL_CTX_set_alpn_select_cb(ctx, alpn_cb, &alpn_ctx);\n#ifndef OPENSSL_NO_DH\n    if (!no_dhe) {\n        DH *dh = NULL;\n        if (dhfile)\n            dh = load_dh_param(dhfile);\n        else if (s_cert_file)\n            dh = load_dh_param(s_cert_file);\n        if (dh != NULL) {\n            BIO_printf(bio_s_out, "Setting temp DH parameters\\n");\n        } else {\n            BIO_printf(bio_s_out, "Using default temp DH parameters\\n");\n        }\n        (void)BIO_flush(bio_s_out);\n        if (dh == NULL)\n            SSL_CTX_set_dh_auto(ctx, 1);\n        else if (!SSL_CTX_set_tmp_dh(ctx, dh)) {\n            BIO_puts(bio_err, "Error setting temp DH parameters\\n");\n            ERR_print_errors(bio_err);\n            DH_free(dh);\n            goto end;\n        }\n        if (ctx2) {\n            if (!dhfile) {\n                DH *dh2 = load_dh_param(s_cert_file2);\n                if (dh2 != NULL) {\n                    BIO_printf(bio_s_out, "Setting temp DH parameters\\n");\n                    (void)BIO_flush(bio_s_out);\n                    DH_free(dh);\n                    dh = dh2;\n                }\n            }\n            if (dh == NULL)\n                SSL_CTX_set_dh_auto(ctx2, 1);\n            else if (!SSL_CTX_set_tmp_dh(ctx2, dh)) {\n                BIO_puts(bio_err, "Error setting temp DH parameters\\n");\n                ERR_print_errors(bio_err);\n                DH_free(dh);\n                goto end;\n            }\n        }\n        DH_free(dh);\n    }\n#endif\n    if (!set_cert_key_stuff(ctx, s_cert, s_key, s_chain, build_chain))\n        goto end;\n    if (s_serverinfo_file != NULL\n        && !SSL_CTX_use_serverinfo_file(ctx, s_serverinfo_file)) {\n        ERR_print_errors(bio_err);\n        goto end;\n    }\n    if (ctx2 && !set_cert_key_stuff(ctx2, s_cert2, s_key2, NULL, build_chain))\n        goto end;\n    if (s_dcert != NULL) {\n        if (!set_cert_key_stuff(ctx, s_dcert, s_dkey, s_dchain, build_chain))\n            goto end;\n    }\n    if (no_resume_ephemeral) {\n        SSL_CTX_set_not_resumable_session_callback(ctx,\n                                                   not_resumable_sess_cb);\n        if (ctx2)\n            SSL_CTX_set_not_resumable_session_callback(ctx2,\n                                                       not_resumable_sess_cb);\n    }\n#ifndef OPENSSL_NO_PSK\n    if (psk_key != NULL) {\n        if (s_debug)\n            BIO_printf(bio_s_out,\n                       "PSK key given, setting server callback\\n");\n        SSL_CTX_set_psk_server_callback(ctx, psk_server_cb);\n    }\n    if (!SSL_CTX_use_psk_identity_hint(ctx, psk_identity_hint)) {\n        BIO_printf(bio_err, "error setting PSK identity hint to context\\n");\n        ERR_print_errors(bio_err);\n        goto end;\n    }\n#endif\n    SSL_CTX_set_verify(ctx, s_server_verify, verify_callback);\n    if (!SSL_CTX_set_session_id_context(ctx,\n                (void *)&s_server_session_id_context,\n                sizeof s_server_session_id_context)) {\n        BIO_printf(bio_err, "error setting session id context\\n");\n        ERR_print_errors(bio_err);\n        goto end;\n    }\n    SSL_CTX_set_cookie_generate_cb(ctx, generate_cookie_callback);\n    SSL_CTX_set_cookie_verify_cb(ctx, verify_cookie_callback);\n    if (ctx2) {\n        SSL_CTX_set_verify(ctx2, s_server_verify, verify_callback);\n        if (!SSL_CTX_set_session_id_context(ctx2,\n                    (void *)&s_server_session_id_context,\n                    sizeof s_server_session_id_context)) {\n            BIO_printf(bio_err, "error setting session id context\\n");\n            ERR_print_errors(bio_err);\n            goto end;\n        }\n        tlsextcbp.biodebug = bio_s_out;\n        SSL_CTX_set_tlsext_servername_callback(ctx2, ssl_servername_cb);\n        SSL_CTX_set_tlsext_servername_arg(ctx2, &tlsextcbp);\n        SSL_CTX_set_tlsext_servername_callback(ctx, ssl_servername_cb);\n        SSL_CTX_set_tlsext_servername_arg(ctx, &tlsextcbp);\n    }\n#ifndef OPENSSL_NO_SRP\n    if (srp_verifier_file != NULL) {\n        srp_callback_parm.vb = SRP_VBASE_new(srpuserseed);\n        srp_callback_parm.user = NULL;\n        srp_callback_parm.login = NULL;\n        if ((ret =\n             SRP_VBASE_init(srp_callback_parm.vb,\n                            srp_verifier_file)) != SRP_NO_ERROR) {\n            BIO_printf(bio_err,\n                       "Cannot initialize SRP verifier file \\"%s\\":ret=%d\\n",\n                       srp_verifier_file, ret);\n            goto end;\n        }\n        SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, verify_callback);\n        SSL_CTX_set_srp_cb_arg(ctx, &srp_callback_parm);\n        SSL_CTX_set_srp_username_callback(ctx, ssl_srp_server_param_cb);\n    } else\n#endif\n    if (CAfile != NULL) {\n        SSL_CTX_set_client_CA_list(ctx, SSL_load_client_CA_file(CAfile));\n        if (ctx2)\n            SSL_CTX_set_client_CA_list(ctx2, SSL_load_client_CA_file(CAfile));\n    }\n    if (s_tlsextstatus) {\n        SSL_CTX_set_tlsext_status_cb(ctx, cert_status_cb);\n        SSL_CTX_set_tlsext_status_arg(ctx, &tlscstatp);\n        if (ctx2) {\n            SSL_CTX_set_tlsext_status_cb(ctx2, cert_status_cb);\n            SSL_CTX_set_tlsext_status_arg(ctx2, &tlscstatp);\n        }\n    }\n    BIO_printf(bio_s_out, "ACCEPT\\n");\n    (void)BIO_flush(bio_s_out);\n    if (rev)\n        server_cb = rev_body;\n    else if (www)\n        server_cb = www_body;\n    else\n        server_cb = sv_body;\n#ifdef AF_UNIX\n    if (socket_family == AF_UNIX\n        && unlink_unix_path)\n        unlink(host);\n#endif\n    do_server(&accept_socket, host, port, socket_family, socket_type,\n              server_cb, context, naccept);\n    print_stats(bio_s_out, ctx);\n    ret = 0;\n end:\n    SSL_CTX_free(ctx);\n    X509_free(s_cert);\n    sk_X509_CRL_pop_free(crls, X509_CRL_free);\n    X509_free(s_dcert);\n    EVP_PKEY_free(s_key);\n    EVP_PKEY_free(s_dkey);\n    sk_X509_pop_free(s_chain, X509_free);\n    sk_X509_pop_free(s_dchain, X509_free);\n    OPENSSL_free(pass);\n    OPENSSL_free(dpass);\n    OPENSSL_free(host);\n    OPENSSL_free(port);\n    X509_VERIFY_PARAM_free(vpm);\n    free_sessions();\n    OPENSSL_free(tlscstatp.host);\n    OPENSSL_free(tlscstatp.port);\n    OPENSSL_free(tlscstatp.path);\n    SSL_CTX_free(ctx2);\n    X509_free(s_cert2);\n    EVP_PKEY_free(s_key2);\n    BIO_free(serverinfo_in);\n#ifndef OPENSSL_NO_NEXTPROTONEG\n    OPENSSL_free(next_proto.data);\n#endif\n    OPENSSL_free(alpn_ctx.data);\n    ssl_excert_free(exc);\n    sk_OPENSSL_STRING_free(ssl_args);\n    SSL_CONF_CTX_free(cctx);\n    BIO_free(bio_s_out);\n    bio_s_out = NULL;\n    BIO_free(bio_s_msg);\n    bio_s_msg = NULL;\n    return (ret);\n}', 'X509 *load_cert(const char *file, int format, const char *cert_descrip)\n{\n    X509 *x = NULL;\n    BIO *cert;\n    if (format == FORMAT_HTTP) {\n#ifndef OPENSSL_NO_OCSP\n        load_cert_crl_http(file, &x, NULL);\n#endif\n        return x;\n    }\n    if (file == NULL) {\n        unbuffer(stdin);\n        cert = dup_bio_in(format);\n    } else\n        cert = bio_open_default(file, \'r\', format);\n    if (cert == NULL)\n        goto end;\n    if (format == FORMAT_ASN1)\n        x = d2i_X509_bio(cert, NULL);\n    else if (format == FORMAT_PEM)\n        x = PEM_read_bio_X509_AUX(cert, NULL,\n                                  (pem_password_cb *)password_callback, NULL);\n    else if (format == FORMAT_PKCS12) {\n        if (!load_pkcs12(cert, cert_descrip, NULL, NULL, NULL, &x, NULL))\n            goto end;\n    } else {\n        BIO_printf(bio_err, "bad input format specified for %s\\n", cert_descrip);\n        goto end;\n    }\n end:\n    if (x == NULL) {\n        BIO_printf(bio_err, "unable to load certificate\\n");\n        ERR_print_errors(bio_err);\n    }\n    BIO_free(cert);\n    return (x);\n}', 'static int load_cert_crl_http(const char *url, X509 **pcert, X509_CRL **pcrl)\n{\n    char *host = NULL, *port = NULL, *path = NULL;\n    BIO *bio = NULL;\n    OCSP_REQ_CTX *rctx = NULL;\n    int use_ssl, rv = 0;\n    if (!OCSP_parse_url(url, &host, &port, &path, &use_ssl))\n        goto err;\n    if (use_ssl) {\n        BIO_puts(bio_err, "https not supported\\n");\n        goto err;\n    }\n    bio = BIO_new_connect(host);\n    if (!bio || !BIO_set_conn_port(bio, port))\n        goto err;\n    rctx = OCSP_REQ_CTX_new(bio, 1024);\n    if (rctx == NULL)\n        goto err;\n    if (!OCSP_REQ_CTX_http(rctx, "GET", path))\n        goto err;\n    if (!OCSP_REQ_CTX_add1_header(rctx, "Host", host))\n        goto err;\n    if (pcert) {\n        do {\n            rv = X509_http_nbio(rctx, pcert);\n        } while (rv == -1);\n    } else {\n        do {\n            rv = X509_CRL_http_nbio(rctx, pcrl);\n        } while (rv == -1);\n    }\n err:\n    OPENSSL_free(host);\n    OPENSSL_free(path);\n    OPENSSL_free(port);\n    if (bio)\n        BIO_free_all(bio);\n    OCSP_REQ_CTX_free(rctx);\n    if (rv != 1) {\n        BIO_printf(bio_err, "Error loading %s from %s\\n",\n                   pcert ? "certificate" : "CRL", url);\n        ERR_print_errors(bio_err);\n    }\n    return rv;\n}', 'int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,\n                   int *pssl)\n{\n    char *p, *buf;\n    char *host, *port;\n    *phost = NULL;\n    *pport = NULL;\n    *ppath = NULL;\n    buf = OPENSSL_strdup(url);\n    if (!buf)\n        goto mem_err;\n    p = strchr(buf, \':\');\n    if (!p)\n        goto parse_err;\n    *(p++) = \'\\0\';\n    if (strcmp(buf, "http") == 0) {\n        *pssl = 0;\n        port = "80";\n    } else if (strcmp(buf, "https") == 0) {\n        *pssl = 1;\n        port = "443";\n    } else\n        goto parse_err;\n    if ((p[0] != \'/\') || (p[1] != \'/\'))\n        goto parse_err;\n    p += 2;\n    host = p;\n    p = strchr(p, \'/\');\n    if (!p)\n        *ppath = OPENSSL_strdup("/");\n    else {\n        *ppath = OPENSSL_strdup(p);\n        *p = \'\\0\';\n    }\n    if (!*ppath)\n        goto mem_err;\n    p = host;\n    if (host[0] == \'[\') {\n        host++;\n        p = strchr(host, \']\');\n        if (!p)\n            goto parse_err;\n        *p = \'\\0\';\n        p++;\n    }\n    if ((p = strchr(p, \':\'))) {\n        *p = 0;\n        port = p + 1;\n    }\n    *pport = OPENSSL_strdup(port);\n    if (!*pport)\n        goto mem_err;\n    *phost = OPENSSL_strdup(host);\n    if (!*phost)\n        goto mem_err;\n    OPENSSL_free(buf);\n    return 1;\n mem_err:\n    OCSPerr(OCSP_F_OCSP_PARSE_URL, ERR_R_MALLOC_FAILURE);\n    goto err;\n parse_err:\n    OCSPerr(OCSP_F_OCSP_PARSE_URL, OCSP_R_ERROR_PARSING_URL);\n err:\n    OPENSSL_free(buf);\n    OPENSSL_free(*ppath);\n    *ppath = NULL;\n    OPENSSL_free(*pport);\n    *pport = NULL;\n    OPENSSL_free(*phost);\n    *phost = NULL;\n    return 0;\n}', 'unsigned char *next_protos_parse(size_t *outlen, const char *in)\n{\n    size_t len;\n    unsigned char *out;\n    size_t i, start = 0;\n    len = strlen(in);\n    if (len >= 65535)\n        return NULL;\n    out = app_malloc(strlen(in) + 1, "NPN buffer");\n    for (i = 0; i <= len; ++i) {\n        if (i == len || in[i] == \',\') {\n            if (i - start > 255) {\n                OPENSSL_free(out);\n                return NULL;\n            }\n            out[start] = i - start;\n            start = i + 1;\n        } else\n            out[i + 1] = in[i];\n    }\n    *outlen = len + 1;\n    return out;\n}', 'void* app_malloc(int sz, const char *what)\n{\n    void *vp = OPENSSL_malloc(sz);\n    if (vp == NULL) {\n        BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\\n",\n                opt_getprog(), sz, what);\n        ERR_print_errors(bio_err);\n        exit(1);\n    }\n    return vp;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    osslargused(file); osslargused(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}']