OPENSSL_DIR_read:
   86|  30.7k|{
   87|  30.7k|    struct dirent *direntry = NULL;
   88|       |
   89|  30.7k|    if (ctx == NULL || directory == NULL) {
  ------------------
  |  Branch (89:9): [True: 0, False: 30.7k]
  |  Branch (89:24): [True: 0, False: 30.7k]
  ------------------
   90|      0|        errno = EINVAL;
   91|      0|        return 0;
   92|      0|    }
   93|       |
   94|  30.7k|    errno = 0;
   95|  30.7k|    if (*ctx == NULL) {
  ------------------
  |  Branch (95:9): [True: 383, False: 30.3k]
  ------------------
   96|    383|        *ctx = malloc(sizeof(**ctx));
   97|    383|        if (*ctx == NULL) {
  ------------------
  |  Branch (97:13): [True: 0, False: 383]
  ------------------
   98|      0|            errno = ENOMEM;
   99|      0|            return 0;
  100|      0|        }
  101|    383|        memset(*ctx, 0, sizeof(**ctx));
  102|       |
  103|       |#ifdef __VMS
  104|       |        {
  105|       |            char c = directory[strlen(directory) - 1];
  106|       |
  107|       |            if (c == ']' || c == '>' || c == ':')
  108|       |                (*ctx)->expect_file_generations = 1;
  109|       |        }
  110|       |#endif
  111|       |
  112|    383|        (*ctx)->dir = opendir(directory);
  113|    383|        if ((*ctx)->dir == NULL) {
  ------------------
  |  Branch (113:13): [True: 0, False: 383]
  ------------------
  114|      0|            int save_errno = errno; /* Probably not needed, but I'm paranoid */
  115|      0|            free(*ctx);
  116|      0|            *ctx = NULL;
  117|      0|            errno = save_errno;
  118|      0|            return 0;
  119|      0|        }
  120|    383|    }
  121|       |
  122|       |#ifdef __VMS
  123|       |    strncpy((*ctx)->previous_entry_name, (*ctx)->entry_name,
  124|       |            sizeof((*ctx)->previous_entry_name));
  125|       |
  126|       | again:
  127|       |#endif
  128|       |
  129|  30.7k|    direntry = readdir((*ctx)->dir);
  130|  30.7k|    if (direntry == NULL) {
  ------------------
  |  Branch (130:9): [True: 338, False: 30.4k]
  ------------------
  131|    338|        return 0;
  132|    338|    }
  133|       |
  134|  30.4k|    OPENSSL_strlcpy((*ctx)->entry_name, direntry->d_name,
  135|  30.4k|                    sizeof((*ctx)->entry_name));
  136|       |#ifdef __VMS
  137|       |    if ((*ctx)->expect_file_generations) {
  138|       |        char *p = (*ctx)->entry_name + strlen((*ctx)->entry_name);
  139|       |
  140|       |        while (p > (*ctx)->entry_name && isdigit((unsigned char)p[-1]))
  141|       |            p--;
  142|       |        if (p > (*ctx)->entry_name && p[-1] == ';')
  143|       |            p[-1] = '\0';
  144|       |        if (OPENSSL_strcasecmp((*ctx)->entry_name,
  145|       |                               (*ctx)->previous_entry_name) == 0)
  146|       |            goto again;
  147|       |    }
  148|       |#endif
  149|  30.4k|    return (*ctx)->entry_name;
  150|  30.7k|}
OPENSSL_DIR_end:
  153|    383|{
  154|    383|    if (ctx != NULL && *ctx != NULL) {
  ------------------
  |  Branch (154:9): [True: 383, False: 0]
  |  Branch (154:24): [True: 383, False: 0]
  ------------------
  155|    383|        int ret = closedir((*ctx)->dir);
  156|       |
  157|    383|        free(*ctx);
  158|    383|        switch (ret) {
  159|    383|        case 0:
  ------------------
  |  Branch (159:9): [True: 383, False: 0]
  ------------------
  160|    383|            return 1;
  161|      0|        case -1:
  ------------------
  |  Branch (161:9): [True: 0, False: 383]
  ------------------
  162|      0|            return 0;
  163|      0|        default:
  ------------------
  |  Branch (163:9): [True: 0, False: 383]
  ------------------
  164|      0|            break;
  165|    383|        }
  166|    383|    }
  167|      0|    errno = EINVAL;
  168|      0|    return 0;
  169|    383|}

ossl_err_load_ASN1_strings:
  206|      2|{
  207|      2|#ifndef OPENSSL_NO_ERR
  208|      2|    if (ERR_reason_error_string(ASN1_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (208:9): [True: 2, False: 0]
  ------------------
  209|      2|        ERR_load_strings_const(ASN1_str_reasons);
  210|      2|#endif
  211|      2|    return 1;
  212|      2|}

ossl_err_load_ASYNC_strings:
   31|      2|{
   32|      2|#ifndef OPENSSL_NO_ERR
   33|      2|    if (ERR_reason_error_string(ASYNC_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (33:9): [True: 2, False: 0]
  ------------------
   34|      2|        ERR_load_strings_const(ASYNC_str_reasons);
   35|      2|#endif
   36|      2|    return 1;
   37|      2|}

ossl_err_load_BIO_strings:
   80|      2|{
   81|      2|#ifndef OPENSSL_NO_ERR
   82|      2|    if (ERR_reason_error_string(BIO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (82:9): [True: 2, False: 0]
  ------------------
   83|      2|        ERR_load_strings_const(BIO_str_reasons);
   84|      2|#endif
   85|      2|    return 1;
   86|      2|}

BIO_new_ex:
   82|  3.38k|{
   83|  3.38k|    BIO *bio = OPENSSL_zalloc(sizeof(*bio));
  ------------------
  |  |   98|  3.38k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.38k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.38k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|       |
   85|  3.38k|    if (bio == NULL) {
  ------------------
  |  Branch (85:9): [True: 0, False: 3.38k]
  ------------------
   86|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   87|      0|        return NULL;
   88|      0|    }
   89|       |
   90|  3.38k|    bio->libctx = libctx;
   91|  3.38k|    bio->method = method;
   92|  3.38k|    bio->shutdown = 1;
   93|  3.38k|    bio->references = 1;
   94|       |
   95|  3.38k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data))
  ------------------
  |  |  229|  3.38k|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  |  Branch (95:9): [True: 0, False: 3.38k]
  ------------------
   96|      0|        goto err;
   97|       |
   98|  3.38k|    bio->lock = CRYPTO_THREAD_lock_new();
   99|  3.38k|    if (bio->lock == NULL) {
  ------------------
  |  Branch (99:9): [True: 0, False: 3.38k]
  ------------------
  100|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  101|      0|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
  ------------------
  |  |  229|      0|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  102|      0|        goto err;
  103|      0|    }
  104|       |
  105|  3.38k|    if (method->create != NULL && !method->create(bio)) {
  ------------------
  |  Branch (105:9): [True: 3.38k, False: 0]
  |  Branch (105:35): [True: 0, False: 3.38k]
  ------------------
  106|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  107|      0|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
  ------------------
  |  |  229|      0|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  108|      0|        CRYPTO_THREAD_lock_free(bio->lock);
  109|      0|        goto err;
  110|      0|    }
  111|  3.38k|    if (method->create == NULL)
  ------------------
  |  Branch (111:9): [True: 0, False: 3.38k]
  ------------------
  112|      0|        bio->init = 1;
  113|       |
  114|  3.38k|    return bio;
  115|       |
  116|      0|err:
  117|      0|    OPENSSL_free(bio);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  118|      0|    return NULL;
  119|  3.38k|}
BIO_new:
  122|  3.38k|{
  123|  3.38k|    return BIO_new_ex(NULL, method);
  124|  3.38k|}
BIO_free:
  127|  3.38k|{
  128|  3.38k|    int ret;
  129|       |
  130|  3.38k|    if (a == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 3.38k]
  ------------------
  131|      0|        return 0;
  132|       |
  133|  3.38k|    if (CRYPTO_DOWN_REF(&a->references, &ret, a->lock) <= 0)
  ------------------
  |  Branch (133:9): [True: 0, False: 3.38k]
  ------------------
  134|      0|        return 0;
  135|       |
  136|  3.38k|    REF_PRINT_COUNT("BIO", a);
  ------------------
  |  |  176|  3.38k|    REF_PRINT_EX(text, object->references, (void *)object)
  |  |  ------------------
  |  |  |  |  174|  3.38k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  3.38k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|  3.38k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  137|  3.38k|    if (ret > 0)
  ------------------
  |  Branch (137:9): [True: 0, False: 3.38k]
  ------------------
  138|      0|        return 1;
  139|  3.38k|    REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  168|  3.38k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (168:12): [True: 0, False: 3.38k]
  |  |  ------------------
  ------------------
  140|       |
  141|  3.38k|    if (HAS_CALLBACK(a)) {
  ------------------
  |  |   26|  3.38k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 3.38k]
  |  |  |  Branch (26:52): [True: 0, False: 3.38k]
  |  |  ------------------
  ------------------
  142|      0|        ret = (int)bio_call_callback(a, BIO_CB_FREE, NULL, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  259|      0|# define BIO_CB_FREE     0x01
  ------------------
  143|      0|        if (ret <= 0)
  ------------------
  |  Branch (143:13): [True: 0, False: 0]
  ------------------
  144|      0|            return 0;
  145|      0|    }
  146|       |
  147|  3.38k|    if ((a->method != NULL) && (a->method->destroy != NULL))
  ------------------
  |  Branch (147:9): [True: 3.38k, False: 0]
  |  Branch (147:32): [True: 3.38k, False: 0]
  ------------------
  148|  3.38k|        a->method->destroy(a);
  149|       |
  150|  3.38k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
  ------------------
  |  |  229|  3.38k|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  151|       |
  152|  3.38k|    CRYPTO_THREAD_lock_free(a->lock);
  153|       |
  154|  3.38k|    OPENSSL_free(a);
  ------------------
  |  |  106|  3.38k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.38k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.38k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  155|       |
  156|  3.38k|    return 1;
  157|  3.38k|}
BIO_vfree:
  190|    258|{
  191|    258|    BIO_free(a);
  192|    258|}
BIO_clear_flags:
  207|  13.5M|{
  208|  13.5M|    b->flags &= ~flags;
  209|  13.5M|}
BIO_write:
  378|  3.13k|{
  379|  3.13k|    size_t written;
  380|  3.13k|    int ret;
  381|       |
  382|  3.13k|    if (dlen <= 0)
  ------------------
  |  Branch (382:9): [True: 0, False: 3.13k]
  ------------------
  383|      0|        return 0;
  384|       |
  385|  3.13k|    ret = bio_write_intern(b, data, (size_t)dlen, &written);
  386|       |
  387|  3.13k|    if (ret > 0) {
  ------------------
  |  Branch (387:9): [True: 3.13k, False: 0]
  ------------------
  388|       |        /* written should always be <= dlen */
  389|  3.13k|        ret = (int)written;
  390|  3.13k|    }
  391|       |
  392|  3.13k|    return ret;
  393|  3.13k|}
BIO_gets:
  451|  6.80M|{
  452|  6.80M|    int ret;
  453|  6.80M|    size_t readbytes = 0;
  454|       |
  455|  6.80M|    if (b == NULL) {
  ------------------
  |  Branch (455:9): [True: 0, False: 6.80M]
  ------------------
  456|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  457|      0|        return -1;
  458|      0|    }
  459|  6.80M|    if (b->method == NULL || b->method->bgets == NULL) {
  ------------------
  |  Branch (459:9): [True: 0, False: 6.80M]
  |  Branch (459:30): [True: 0, False: 6.80M]
  ------------------
  460|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  461|      0|        return -2;
  462|      0|    }
  463|       |
  464|  6.80M|    if (size < 0) {
  ------------------
  |  Branch (464:9): [True: 0, False: 6.80M]
  ------------------
  465|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  466|      0|        return -1;
  467|      0|    }
  468|       |
  469|  6.80M|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|  6.80M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 6.80M]
  |  |  |  Branch (26:52): [True: 0, False: 6.80M]
  |  |  ------------------
  ------------------
  470|      0|        ret = (int)bio_call_callback(b, BIO_CB_GETS, buf, size, 0, 0L, 1, NULL);
  ------------------
  |  |  263|      0|# define BIO_CB_GETS     0x05
  ------------------
  471|      0|        if (ret <= 0)
  ------------------
  |  Branch (471:13): [True: 0, False: 0]
  ------------------
  472|      0|            return ret;
  473|      0|    }
  474|       |
  475|  6.80M|    if (!b->init) {
  ------------------
  |  Branch (475:9): [True: 0, False: 6.80M]
  ------------------
  476|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  477|      0|        return -1;
  478|      0|    }
  479|       |
  480|  6.80M|    ret = b->method->bgets(b, buf, size);
  481|       |
  482|  6.80M|    if (ret > 0) {
  ------------------
  |  Branch (482:9): [True: 6.80M, False: 5.17k]
  ------------------
  483|  6.80M|        readbytes = ret;
  484|  6.80M|        ret = 1;
  485|  6.80M|    }
  486|       |
  487|  6.80M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  6.80M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 6.80M]
  |  |  |  Branch (26:52): [True: 0, False: 6.80M]
  |  |  ------------------
  ------------------
  488|      0|        ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
  ------------------
  |  |  263|      0|# define BIO_CB_GETS     0x05
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
  ------------------
  |  |  270|      0|# define BIO_CB_RETURN   0x80
  ------------------
  489|      0|                                     0, 0L, ret, &readbytes);
  490|       |
  491|  6.80M|    if (ret > 0) {
  ------------------
  |  Branch (491:9): [True: 6.80M, False: 5.17k]
  ------------------
  492|       |        /* Shouldn't happen */
  493|  6.80M|        if (readbytes > (size_t)size)
  ------------------
  |  Branch (493:13): [True: 0, False: 6.80M]
  ------------------
  494|      0|            ret = -1;
  495|  6.80M|        else
  496|  6.80M|            ret = (int)readbytes;
  497|  6.80M|    }
  498|       |
  499|  6.80M|    return ret;
  500|  6.80M|}
BIO_ctrl:
  564|    258|{
  565|    258|    long ret;
  566|       |
  567|    258|    if (b == NULL)
  ------------------
  |  Branch (567:9): [True: 0, False: 258]
  ------------------
  568|      0|        return -1;
  569|    258|    if (b->method == NULL || b->method->ctrl == NULL) {
  ------------------
  |  Branch (569:9): [True: 0, False: 258]
  |  Branch (569:30): [True: 0, False: 258]
  ------------------
  570|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  571|      0|        return -2;
  572|      0|    }
  573|       |
  574|    258|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|    258|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 258]
  |  |  |  Branch (26:52): [True: 0, False: 258]
  |  |  ------------------
  ------------------
  575|      0|        ret = bio_call_callback(b, BIO_CB_CTRL, parg, 0, cmd, larg, 1L, NULL);
  ------------------
  |  |  264|      0|# define BIO_CB_CTRL     0x06
  ------------------
  576|      0|        if (ret <= 0)
  ------------------
  |  Branch (576:13): [True: 0, False: 0]
  ------------------
  577|      0|            return ret;
  578|      0|    }
  579|       |
  580|    258|    ret = b->method->ctrl(b, cmd, larg, parg);
  581|       |
  582|    258|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|    258|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 258]
  |  |  |  Branch (26:52): [True: 0, False: 258]
  |  |  ------------------
  ------------------
  583|      0|        ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  264|      0|# define BIO_CB_CTRL     0x06
  ------------------
                      ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  270|      0|# define BIO_CB_RETURN   0x80
  ------------------
  584|      0|                                larg, ret, NULL);
  585|       |
  586|    258|    return ret;
  587|    258|}
bio_cleanup:
  850|      2|{
  851|      2|#ifndef OPENSSL_NO_SOCK
  852|      2|    bio_sock_cleanup_int();
  853|      2|    CRYPTO_THREAD_lock_free(bio_lookup_lock);
  854|      2|    bio_lookup_lock = NULL;
  855|      2|#endif
  856|      2|    CRYPTO_THREAD_lock_free(bio_type_lock);
  857|      2|    bio_type_lock = NULL;
  858|      2|}
bio_lib.c:bio_write_intern:
  335|  3.13k|{
  336|  3.13k|    size_t local_written;
  337|  3.13k|    int ret;
  338|       |
  339|  3.13k|    if (written != NULL)
  ------------------
  |  Branch (339:9): [True: 3.13k, False: 0]
  ------------------
  340|  3.13k|        *written = 0;
  341|       |    /*
  342|       |     * b == NULL is not an error but just means that zero bytes are written.
  343|       |     * Do not raise an error here.
  344|       |     */
  345|  3.13k|    if (b == NULL)
  ------------------
  |  Branch (345:9): [True: 0, False: 3.13k]
  ------------------
  346|      0|        return 0;
  347|       |
  348|  3.13k|    if (b->method == NULL || b->method->bwrite == NULL) {
  ------------------
  |  Branch (348:9): [True: 0, False: 3.13k]
  |  Branch (348:30): [True: 0, False: 3.13k]
  ------------------
  349|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|      0|        return -2;
  351|      0|    }
  352|       |
  353|  3.13k|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|  6.26k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 3.13k]
  |  |  |  Branch (26:52): [True: 0, False: 3.13k]
  |  |  ------------------
  ------------------
  354|  3.13k|        ((ret = (int)bio_call_callback(b, BIO_CB_WRITE, data, dlen, 0, 0L, 1L,
  ------------------
  |  |  261|      0|# define BIO_CB_WRITE    0x03
  ------------------
  |  Branch (354:9): [True: 0, False: 0]
  ------------------
  355|      0|                                       NULL)) <= 0))
  356|      0|        return ret;
  357|       |
  358|  3.13k|    if (!b->init) {
  ------------------
  |  Branch (358:9): [True: 0, False: 3.13k]
  ------------------
  359|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  360|      0|        return -1;
  361|      0|    }
  362|       |
  363|  3.13k|    ret = b->method->bwrite(b, data, dlen, &local_written);
  364|       |
  365|  3.13k|    if (ret > 0)
  ------------------
  |  Branch (365:9): [True: 3.13k, False: 0]
  ------------------
  366|  3.13k|        b->num_write += (uint64_t)local_written;
  367|       |
  368|  3.13k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  3.13k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 3.13k]
  |  |  |  Branch (26:52): [True: 0, False: 3.13k]
  |  |  ------------------
  ------------------
  369|      0|        ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  261|      0|# define BIO_CB_WRITE    0x03
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  270|      0|# define BIO_CB_RETURN   0x80
  ------------------
  370|      0|                                     dlen, 0, 0L, ret, &local_written);
  371|       |
  372|  3.13k|    if (written != NULL)
  ------------------
  |  Branch (372:9): [True: 3.13k, False: 0]
  ------------------
  373|  3.13k|        *written = local_written;
  374|  3.13k|    return ret;
  375|  3.13k|}

bwrite_conv:
   71|  3.13k|{
   72|  3.13k|    int ret;
   73|       |
   74|  3.13k|    if (datal > INT_MAX)
  ------------------
  |  Branch (74:9): [True: 0, False: 3.13k]
  ------------------
   75|      0|        datal = INT_MAX;
   76|       |
   77|  3.13k|    ret = bio->method->bwrite_old(bio, data, (int)datal);
   78|       |
   79|  3.13k|    if (ret <= 0) {
  ------------------
  |  Branch (79:9): [True: 0, False: 3.13k]
  ------------------
   80|      0|        *written = 0;
   81|      0|        return ret;
   82|      0|    }
   83|       |
   84|  3.13k|    *written = (size_t)ret;
   85|       |
   86|  3.13k|    return 1;
   87|  3.13k|}

BIO_snprintf:
  931|  1.14k|{
  932|  1.14k|    va_list args;
  933|  1.14k|    int ret;
  934|       |
  935|  1.14k|    va_start(args, format);
  936|       |
  937|  1.14k|    ret = BIO_vsnprintf(buf, n, format, args);
  938|       |
  939|  1.14k|    va_end(args);
  940|  1.14k|    return ret;
  941|  1.14k|}
BIO_vsnprintf:
  944|  4.02k|{
  945|  4.02k|    size_t retlen;
  946|  4.02k|    int truncated;
  947|       |
  948|  4.02k|    if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
  ------------------
  |  Branch (948:9): [True: 0, False: 4.02k]
  ------------------
  949|      0|        return -1;
  950|       |
  951|  4.02k|    if (truncated)
  ------------------
  |  Branch (951:9): [True: 1.63k, False: 2.39k]
  ------------------
  952|       |        /*
  953|       |         * In case of truncation, return -1 like traditional snprintf.
  954|       |         * (Current drafts for ISO/IEC 9899 say snprintf should return the
  955|       |         * number of characters that would have been written, had the buffer
  956|       |         * been large enough.)
  957|       |         */
  958|  1.63k|        return -1;
  959|  2.39k|    return (retlen <= INT_MAX) ? (int)retlen : -1;
  ------------------
  |  Branch (959:12): [True: 2.39k, False: 0]
  ------------------
  960|  4.02k|}
bio_print.c:_dopr:
   91|  4.02k|{
   92|  4.02k|    char ch;
   93|  4.02k|    int64_t value;
   94|  4.02k|#ifndef OPENSSL_SYS_UEFI
   95|  4.02k|    LDOUBLE fvalue;
  ------------------
  |  |   28|  4.02k|# define LDOUBLE double
  ------------------
   96|  4.02k|#endif
   97|  4.02k|    char *strvalue;
   98|  4.02k|    int min;
   99|  4.02k|    int max;
  100|  4.02k|    int state;
  101|  4.02k|    int flags;
  102|  4.02k|    int cflags;
  103|  4.02k|    size_t currlen;
  104|       |
  105|  4.02k|    state = DP_S_DEFAULT;
  ------------------
  |  |   45|  4.02k|#define DP_S_DEFAULT    0
  ------------------
  106|  4.02k|    flags = currlen = cflags = min = 0;
  107|  4.02k|    max = -1;
  108|  4.02k|    ch = *format++;
  109|       |
  110|  67.6k|    while (state != DP_S_DONE) {
  ------------------
  |  |   52|  67.6k|#define DP_S_DONE       7
  ------------------
  |  Branch (110:12): [True: 63.6k, False: 4.02k]
  ------------------
  111|  63.6k|        if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
  ------------------
  |  Branch (111:13): [True: 2.41k, False: 61.1k]
  |  Branch (111:28): [True: 61.1k, False: 0]
  |  Branch (111:46): [True: 1.61k, False: 59.5k]
  ------------------
  112|  4.02k|            state = DP_S_DONE;
  ------------------
  |  |   52|  4.02k|#define DP_S_DONE       7
  ------------------
  113|       |
  114|  63.6k|        switch (state) {
  115|  39.4k|        case DP_S_DEFAULT:
  ------------------
  |  |   45|  39.4k|#define DP_S_DEFAULT    0
  ------------------
  |  Branch (115:9): [True: 39.4k, False: 24.1k]
  ------------------
  116|  39.4k|            if (ch == '%')
  ------------------
  |  Branch (116:17): [True: 4.02k, False: 35.4k]
  ------------------
  117|  4.02k|                state = DP_S_FLAGS;
  ------------------
  |  |   46|  4.02k|#define DP_S_FLAGS      1
  ------------------
  118|  35.4k|            else
  119|  35.4k|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (119:21): [True: 0, False: 35.4k]
  ------------------
  120|      0|                    return 0;
  121|  39.4k|            ch = *format++;
  122|  39.4k|            break;
  123|  4.02k|        case DP_S_FLAGS:
  ------------------
  |  |   46|  4.02k|#define DP_S_FLAGS      1
  ------------------
  |  Branch (123:9): [True: 4.02k, False: 59.5k]
  ------------------
  124|  4.02k|            switch (ch) {
  125|      0|            case '-':
  ------------------
  |  Branch (125:13): [True: 0, False: 4.02k]
  ------------------
  126|      0|                flags |= DP_F_MINUS;
  ------------------
  |  |   56|      0|#define DP_F_MINUS      (1 << 0)
  ------------------
  127|      0|                ch = *format++;
  128|      0|                break;
  129|      0|            case '+':
  ------------------
  |  Branch (129:13): [True: 0, False: 4.02k]
  ------------------
  130|      0|                flags |= DP_F_PLUS;
  ------------------
  |  |   58|      0|#define DP_F_PLUS       (1 << 1)
  ------------------
  131|      0|                ch = *format++;
  132|      0|                break;
  133|      0|            case ' ':
  ------------------
  |  Branch (133:13): [True: 0, False: 4.02k]
  ------------------
  134|      0|                flags |= DP_F_SPACE;
  ------------------
  |  |   60|      0|#define DP_F_SPACE      (1 << 2)
  ------------------
  135|      0|                ch = *format++;
  136|      0|                break;
  137|      0|            case '#':
  ------------------
  |  Branch (137:13): [True: 0, False: 4.02k]
  ------------------
  138|      0|                flags |= DP_F_NUM;
  ------------------
  |  |   62|      0|#define DP_F_NUM        (1 << 3)
  ------------------
  139|      0|                ch = *format++;
  140|      0|                break;
  141|      0|            case '0':
  ------------------
  |  Branch (141:13): [True: 0, False: 4.02k]
  ------------------
  142|      0|                flags |= DP_F_ZERO;
  ------------------
  |  |   64|      0|#define DP_F_ZERO       (1 << 4)
  ------------------
  143|      0|                ch = *format++;
  144|      0|                break;
  145|  4.02k|            default:
  ------------------
  |  Branch (145:13): [True: 4.02k, False: 0]
  ------------------
  146|  4.02k|                state = DP_S_MIN;
  ------------------
  |  |   47|  4.02k|#define DP_S_MIN        2
  ------------------
  147|  4.02k|                break;
  148|  4.02k|            }
  149|  4.02k|            break;
  150|  4.02k|        case DP_S_MIN:
  ------------------
  |  |   47|  4.02k|#define DP_S_MIN        2
  ------------------
  |  Branch (150:9): [True: 4.02k, False: 59.5k]
  ------------------
  151|  4.02k|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (151:17): [True: 0, False: 4.02k]
  ------------------
  152|      0|                min = 10 * min + char_to_int(ch);
  ------------------
  |  |   83|      0|#define char_to_int(p) (p - '0')
  ------------------
  153|      0|                ch = *format++;
  154|  4.02k|            } else if (ch == '*') {
  ------------------
  |  Branch (154:24): [True: 0, False: 4.02k]
  ------------------
  155|      0|                min = va_arg(args, int);
  156|      0|                ch = *format++;
  157|      0|                state = DP_S_DOT;
  ------------------
  |  |   48|      0|#define DP_S_DOT        3
  ------------------
  158|      0|            } else
  159|  4.02k|                state = DP_S_DOT;
  ------------------
  |  |   48|  4.02k|#define DP_S_DOT        3
  ------------------
  160|  4.02k|            break;
  161|  4.02k|        case DP_S_DOT:
  ------------------
  |  |   48|  4.02k|#define DP_S_DOT        3
  ------------------
  |  Branch (161:9): [True: 4.02k, False: 59.5k]
  ------------------
  162|  4.02k|            if (ch == '.') {
  ------------------
  |  Branch (162:17): [True: 0, False: 4.02k]
  ------------------
  163|      0|                state = DP_S_MAX;
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  164|      0|                ch = *format++;
  165|      0|            } else
  166|  4.02k|                state = DP_S_MOD;
  ------------------
  |  |   50|  4.02k|#define DP_S_MOD        5
  ------------------
  167|  4.02k|            break;
  168|      0|        case DP_S_MAX:
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  |  Branch (168:9): [True: 0, False: 63.6k]
  ------------------
  169|      0|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (169:17): [True: 0, False: 0]
  ------------------
  170|      0|                if (max < 0)
  ------------------
  |  Branch (170:21): [True: 0, False: 0]
  ------------------
  171|      0|                    max = 0;
  172|      0|                max = 10 * max + char_to_int(ch);
  ------------------
  |  |   83|      0|#define char_to_int(p) (p - '0')
  ------------------
  173|      0|                ch = *format++;
  174|      0|            } else if (ch == '*') {
  ------------------
  |  Branch (174:24): [True: 0, False: 0]
  ------------------
  175|      0|                max = va_arg(args, int);
  176|      0|                ch = *format++;
  177|      0|                state = DP_S_MOD;
  ------------------
  |  |   50|      0|#define DP_S_MOD        5
  ------------------
  178|      0|            } else
  179|      0|                state = DP_S_MOD;
  ------------------
  |  |   50|      0|#define DP_S_MOD        5
  ------------------
  180|      0|            break;
  181|  4.02k|        case DP_S_MOD:
  ------------------
  |  |   50|  4.02k|#define DP_S_MOD        5
  ------------------
  |  Branch (181:9): [True: 4.02k, False: 59.5k]
  ------------------
  182|  4.02k|            switch (ch) {
  183|      0|            case 'h':
  ------------------
  |  Branch (183:13): [True: 0, False: 4.02k]
  ------------------
  184|      0|                cflags = DP_C_SHORT;
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  185|      0|                ch = *format++;
  186|      0|                break;
  187|  1.14k|            case 'l':
  ------------------
  |  Branch (187:13): [True: 1.14k, False: 2.87k]
  ------------------
  188|  1.14k|                if (*format == 'l') {
  ------------------
  |  Branch (188:21): [True: 0, False: 1.14k]
  ------------------
  189|      0|                    cflags = DP_C_LLONG;
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  190|      0|                    format++;
  191|      0|                } else
  192|  1.14k|                    cflags = DP_C_LONG;
  ------------------
  |  |   72|  1.14k|#define DP_C_LONG       2
  ------------------
  193|  1.14k|                ch = *format++;
  194|  1.14k|                break;
  195|      0|            case 'q':
  ------------------
  |  Branch (195:13): [True: 0, False: 4.02k]
  ------------------
  196|      0|            case 'j':
  ------------------
  |  Branch (196:13): [True: 0, False: 4.02k]
  ------------------
  197|      0|                cflags = DP_C_LLONG;
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  198|      0|                ch = *format++;
  199|      0|                break;
  200|      0|            case 'L':
  ------------------
  |  Branch (200:13): [True: 0, False: 4.02k]
  ------------------
  201|      0|                cflags = DP_C_LDOUBLE;
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  202|      0|                ch = *format++;
  203|      0|                break;
  204|      0|            case 'z':
  ------------------
  |  Branch (204:13): [True: 0, False: 4.02k]
  ------------------
  205|      0|                cflags = DP_C_SIZE;
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  206|      0|                ch = *format++;
  207|      0|                break;
  208|  2.87k|            default:
  ------------------
  |  Branch (208:13): [True: 2.87k, False: 1.14k]
  ------------------
  209|  2.87k|                break;
  210|  4.02k|            }
  211|  4.02k|            state = DP_S_CONV;
  ------------------
  |  |   51|  4.02k|#define DP_S_CONV       6
  ------------------
  212|  4.02k|            break;
  213|  4.02k|        case DP_S_CONV:
  ------------------
  |  |   51|  4.02k|#define DP_S_CONV       6
  ------------------
  |  Branch (213:9): [True: 4.02k, False: 59.5k]
  ------------------
  214|  4.02k|            switch (ch) {
  215|  1.14k|            case 'd':
  ------------------
  |  Branch (215:13): [True: 1.14k, False: 2.87k]
  ------------------
  216|  1.14k|            case 'i':
  ------------------
  |  Branch (216:13): [True: 0, False: 4.02k]
  ------------------
  217|  1.14k|                switch (cflags) {
  218|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (218:17): [True: 0, False: 1.14k]
  ------------------
  219|      0|                    value = (short int)va_arg(args, int);
  220|      0|                    break;
  221|  1.14k|                case DP_C_LONG:
  ------------------
  |  |   72|  1.14k|#define DP_C_LONG       2
  ------------------
  |  Branch (221:17): [True: 1.14k, False: 0]
  ------------------
  222|  1.14k|                    value = va_arg(args, long int);
  223|  1.14k|                    break;
  224|      0|                case DP_C_LLONG:
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  |  Branch (224:17): [True: 0, False: 1.14k]
  ------------------
  225|      0|                    value = va_arg(args, int64_t);
  226|      0|                    break;
  227|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (227:17): [True: 0, False: 1.14k]
  ------------------
  228|      0|                    value = va_arg(args, ossl_ssize_t);
  229|      0|                    break;
  230|      0|                default:
  ------------------
  |  Branch (230:17): [True: 0, False: 1.14k]
  ------------------
  231|      0|                    value = va_arg(args, int);
  232|      0|                    break;
  233|  1.14k|                }
  234|  1.14k|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min,
  ------------------
  |  Branch (234:21): [True: 0, False: 1.14k]
  ------------------
  235|  1.14k|                            max, flags))
  236|      0|                    return 0;
  237|  1.14k|                break;
  238|  1.14k|            case 'X':
  ------------------
  |  Branch (238:13): [True: 0, False: 4.02k]
  ------------------
  239|      0|                flags |= DP_F_UP;
  ------------------
  |  |   66|      0|#define DP_F_UP         (1 << 5)
  ------------------
  240|       |                /* FALLTHROUGH */
  241|      0|            case 'x':
  ------------------
  |  Branch (241:13): [True: 0, False: 4.02k]
  ------------------
  242|      0|            case 'o':
  ------------------
  |  Branch (242:13): [True: 0, False: 4.02k]
  ------------------
  243|      0|            case 'u':
  ------------------
  |  Branch (243:13): [True: 0, False: 4.02k]
  ------------------
  244|      0|                flags |= DP_F_UNSIGNED;
  ------------------
  |  |   68|      0|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  245|      0|                switch (cflags) {
  246|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (246:17): [True: 0, False: 0]
  ------------------
  247|      0|                    value = (unsigned short int)va_arg(args, unsigned int);
  248|      0|                    break;
  249|      0|                case DP_C_LONG:
  ------------------
  |  |   72|      0|#define DP_C_LONG       2
  ------------------
  |  Branch (249:17): [True: 0, False: 0]
  ------------------
  250|      0|                    value = va_arg(args, unsigned long int);
  251|      0|                    break;
  252|      0|                case DP_C_LLONG:
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  |  Branch (252:17): [True: 0, False: 0]
  ------------------
  253|      0|                    value = va_arg(args, uint64_t);
  254|      0|                    break;
  255|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (255:17): [True: 0, False: 0]
  ------------------
  256|      0|                    value = va_arg(args, size_t);
  257|      0|                    break;
  258|      0|                default:
  ------------------
  |  Branch (258:17): [True: 0, False: 0]
  ------------------
  259|      0|                    value = va_arg(args, unsigned int);
  260|      0|                    break;
  261|      0|                }
  262|      0|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value,
  ------------------
  |  Branch (262:21): [True: 0, False: 0]
  ------------------
  263|      0|                            ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
  ------------------
  |  Branch (263:29): [True: 0, False: 0]
  |  Branch (263:46): [True: 0, False: 0]
  ------------------
  264|      0|                            min, max, flags))
  265|      0|                    return 0;
  266|      0|                break;
  267|      0|#ifndef OPENSSL_SYS_UEFI
  268|      0|            case 'f':
  ------------------
  |  Branch (268:13): [True: 0, False: 4.02k]
  ------------------
  269|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  |  Branch (269:21): [True: 0, False: 0]
  ------------------
  270|      0|                    fvalue = va_arg(args, LDOUBLE);
  271|      0|                else
  272|      0|                    fvalue = va_arg(args, double);
  273|      0|                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
  ------------------
  |  Branch (273:21): [True: 0, False: 0]
  ------------------
  274|      0|                           flags, F_FORMAT))
  ------------------
  |  |   78|      0|#define F_FORMAT        0
  ------------------
  275|      0|                    return 0;
  276|      0|                break;
  277|      0|            case 'E':
  ------------------
  |  Branch (277:13): [True: 0, False: 4.02k]
  ------------------
  278|      0|                flags |= DP_F_UP;
  ------------------
  |  |   66|      0|#define DP_F_UP         (1 << 5)
  ------------------
  279|       |                /* fall thru */
  280|      0|            case 'e':
  ------------------
  |  Branch (280:13): [True: 0, False: 4.02k]
  ------------------
  281|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  |  Branch (281:21): [True: 0, False: 0]
  ------------------
  282|      0|                    fvalue = va_arg(args, LDOUBLE);
  283|      0|                else
  284|      0|                    fvalue = va_arg(args, double);
  285|      0|                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
  ------------------
  |  Branch (285:21): [True: 0, False: 0]
  ------------------
  286|      0|                           flags, E_FORMAT))
  ------------------
  |  |   79|      0|#define E_FORMAT        1
  ------------------
  287|      0|                    return 0;
  288|      0|                break;
  289|      0|            case 'G':
  ------------------
  |  Branch (289:13): [True: 0, False: 4.02k]
  ------------------
  290|      0|                flags |= DP_F_UP;
  ------------------
  |  |   66|      0|#define DP_F_UP         (1 << 5)
  ------------------
  291|       |                /* fall thru */
  292|      0|            case 'g':
  ------------------
  |  Branch (292:13): [True: 0, False: 4.02k]
  ------------------
  293|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   73|      0|#define DP_C_LDOUBLE    3
  ------------------
  |  Branch (293:21): [True: 0, False: 0]
  ------------------
  294|      0|                    fvalue = va_arg(args, LDOUBLE);
  295|      0|                else
  296|      0|                    fvalue = va_arg(args, double);
  297|      0|                if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
  ------------------
  |  Branch (297:21): [True: 0, False: 0]
  ------------------
  298|      0|                           flags, G_FORMAT))
  ------------------
  |  |   80|      0|#define G_FORMAT        2
  ------------------
  299|      0|                    return 0;
  300|      0|                break;
  301|       |#else
  302|       |            case 'f':
  303|       |            case 'E':
  304|       |            case 'e':
  305|       |            case 'G':
  306|       |            case 'g':
  307|       |                /* not implemented for UEFI */
  308|       |                ERR_raise(ERR_LIB_BIO, ERR_R_UNSUPPORTED);
  309|       |                return 0;
  310|       |#endif
  311|      0|            case 'c':
  ------------------
  |  Branch (311:13): [True: 0, False: 4.02k]
  ------------------
  312|      0|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
  ------------------
  |  Branch (312:21): [True: 0, False: 0]
  ------------------
  313|      0|                                 va_arg(args, int)))
  314|      0|                    return 0;
  315|      0|                break;
  316|  2.87k|            case 's':
  ------------------
  |  Branch (316:13): [True: 2.87k, False: 1.14k]
  ------------------
  317|  2.87k|                strvalue = va_arg(args, char *);
  318|  2.87k|                if (max < 0) {
  ------------------
  |  Branch (318:21): [True: 2.87k, False: 0]
  ------------------
  319|  2.87k|                    if (buffer)
  ------------------
  |  Branch (319:25): [True: 0, False: 2.87k]
  ------------------
  320|      0|                        max = INT_MAX;
  321|  2.87k|                    else
  322|  2.87k|                        max = *maxlen;
  323|  2.87k|                }
  324|  2.87k|                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
  ------------------
  |  Branch (324:21): [True: 0, False: 2.87k]
  ------------------
  325|  2.87k|                            flags, min, max))
  326|      0|                    return 0;
  327|  2.87k|                break;
  328|  2.87k|            case 'p':
  ------------------
  |  Branch (328:13): [True: 0, False: 4.02k]
  ------------------
  329|      0|                value = (size_t)va_arg(args, void *);
  330|      0|                if (!fmtint(sbuffer, buffer, &currlen, maxlen,
  ------------------
  |  Branch (330:21): [True: 0, False: 0]
  ------------------
  331|      0|                            value, 16, min, max, flags | DP_F_NUM))
  ------------------
  |  |   62|      0|#define DP_F_NUM        (1 << 3)
  ------------------
  332|      0|                    return 0;
  333|      0|                break;
  334|      0|            case 'n':
  ------------------
  |  Branch (334:13): [True: 0, False: 4.02k]
  ------------------
  335|      0|                {
  336|      0|                    int *num;
  337|      0|                    num = va_arg(args, int *);
  338|      0|                    *num = currlen;
  339|      0|                }
  340|      0|                break;
  341|      0|            case '%':
  ------------------
  |  Branch (341:13): [True: 0, False: 4.02k]
  ------------------
  342|      0|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (342:21): [True: 0, False: 0]
  ------------------
  343|      0|                    return 0;
  344|      0|                break;
  345|      0|            case 'w':
  ------------------
  |  Branch (345:13): [True: 0, False: 4.02k]
  ------------------
  346|       |                /* not supported yet, treat as next char */
  347|      0|                format++;
  348|      0|                break;
  349|      0|            default:
  ------------------
  |  Branch (349:13): [True: 0, False: 4.02k]
  ------------------
  350|       |                /* unknown, skip */
  351|      0|                break;
  352|  4.02k|            }
  353|  4.02k|            ch = *format++;
  354|  4.02k|            state = DP_S_DEFAULT;
  ------------------
  |  |   45|  4.02k|#define DP_S_DEFAULT    0
  ------------------
  355|  4.02k|            flags = cflags = min = 0;
  356|  4.02k|            max = -1;
  357|  4.02k|            break;
  358|  4.02k|        case DP_S_DONE:
  ------------------
  |  |   52|  4.02k|#define DP_S_DONE       7
  ------------------
  |  Branch (358:9): [True: 4.02k, False: 59.5k]
  ------------------
  359|  4.02k|            break;
  360|      0|        default:
  ------------------
  |  Branch (360:9): [True: 0, False: 63.6k]
  ------------------
  361|      0|            break;
  362|  63.6k|        }
  363|  63.6k|    }
  364|       |    /*
  365|       |     * We have to truncate if there is no dynamic buffer and we have filled the
  366|       |     * static buffer.
  367|       |     */
  368|  4.02k|    if (buffer == NULL) {
  ------------------
  |  Branch (368:9): [True: 4.02k, False: 0]
  ------------------
  369|  4.02k|        *truncated = (currlen > *maxlen - 1);
  370|  4.02k|        if (*truncated)
  ------------------
  |  Branch (370:13): [True: 1.63k, False: 2.39k]
  ------------------
  371|  1.63k|            currlen = *maxlen - 1;
  372|  4.02k|    }
  373|  4.02k|    if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
  ------------------
  |  Branch (373:9): [True: 0, False: 4.02k]
  ------------------
  374|      0|        return 0;
  375|  4.02k|    *retlen = currlen - 1;
  376|  4.02k|    return 1;
  377|  4.02k|}
bio_print.c:doapr_outch:
  835|  1.79M|{
  836|       |    /* If we haven't at least one buffer, someone has done a big booboo */
  837|  1.79M|    if (!ossl_assert(*sbuffer != NULL || buffer != NULL))
  ------------------
  |  |   43|  1.79M|# define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (43:42): [True: 1.79M, False: 0]
  |  |  |  Branch (43:42): [True: 0, False: 0]
  |  |  ------------------
  |  |   44|  1.79M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (837:9): [True: 0, False: 1.79M]
  ------------------
  838|      0|        return 0;
  839|       |
  840|       |    /* |currlen| must always be <= |*maxlen| */
  841|  1.79M|    if (!ossl_assert(*currlen <= *maxlen))
  ------------------
  |  |   43|  1.79M|# define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   44|  1.79M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (841:9): [True: 0, False: 1.79M]
  ------------------
  842|      0|        return 0;
  843|       |
  844|  1.79M|    if (buffer && *currlen == *maxlen) {
  ------------------
  |  Branch (844:9): [True: 0, False: 1.79M]
  |  Branch (844:19): [True: 0, False: 0]
  ------------------
  845|      0|        if (*maxlen > INT_MAX - BUFFER_INC)
  ------------------
  |  |  830|      0|#define BUFFER_INC  1024
  ------------------
  |  Branch (845:13): [True: 0, False: 0]
  ------------------
  846|      0|            return 0;
  847|       |
  848|      0|        *maxlen += BUFFER_INC;
  ------------------
  |  |  830|      0|#define BUFFER_INC  1024
  ------------------
  849|      0|        if (*buffer == NULL) {
  ------------------
  |  Branch (849:13): [True: 0, False: 0]
  ------------------
  850|      0|            if ((*buffer = OPENSSL_malloc(*maxlen)) == NULL) {
  ------------------
  |  |   96|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (850:17): [True: 0, False: 0]
  ------------------
  851|      0|                ERR_raise(ERR_LIB_BIO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  852|      0|                return 0;
  853|      0|            }
  854|      0|            if (*currlen > 0) {
  ------------------
  |  Branch (854:17): [True: 0, False: 0]
  ------------------
  855|      0|                if (!ossl_assert(*sbuffer != NULL))
  ------------------
  |  |   43|      0|# define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   44|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (855:21): [True: 0, False: 0]
  ------------------
  856|      0|                    return 0;
  857|      0|                memcpy(*buffer, *sbuffer, *currlen);
  858|      0|            }
  859|      0|            *sbuffer = NULL;
  860|      0|        } else {
  861|      0|            char *tmpbuf;
  862|       |
  863|      0|            tmpbuf = OPENSSL_realloc(*buffer, *maxlen);
  ------------------
  |  |  100|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  864|      0|            if (tmpbuf == NULL) {
  ------------------
  |  Branch (864:17): [True: 0, False: 0]
  ------------------
  865|      0|                ERR_raise(ERR_LIB_BIO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  866|      0|                return 0;
  867|      0|            }
  868|      0|            *buffer = tmpbuf;
  869|      0|        }
  870|      0|    }
  871|       |
  872|  1.79M|    if (*currlen < *maxlen) {
  ------------------
  |  Branch (872:9): [True: 1.76M, False: 22.6k]
  ------------------
  873|  1.76M|        if (*sbuffer)
  ------------------
  |  Branch (873:13): [True: 1.76M, False: 0]
  ------------------
  874|  1.76M|            (*sbuffer)[(*currlen)++] = (char)c;
  875|      0|        else
  876|      0|            (*buffer)[(*currlen)++] = (char)c;
  877|  1.76M|    }
  878|       |
  879|  1.79M|    return 1;
  880|  1.79M|}
bio_print.c:fmtint:
  436|  1.14k|{
  437|  1.14k|    int signvalue = 0;
  438|  1.14k|    const char *prefix = "";
  439|  1.14k|    uint64_t uvalue;
  440|  1.14k|    char convert[DECIMAL_SIZE(value) + 3];
  441|  1.14k|    int place = 0;
  442|  1.14k|    int spadlen = 0;
  443|  1.14k|    int zpadlen = 0;
  444|  1.14k|    int caps = 0;
  445|       |
  446|  1.14k|    if (max < 0)
  ------------------
  |  Branch (446:9): [True: 1.14k, False: 0]
  ------------------
  447|  1.14k|        max = 0;
  448|  1.14k|    uvalue = value;
  449|  1.14k|    if (!(flags & DP_F_UNSIGNED)) {
  ------------------
  |  |   68|  1.14k|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  |  Branch (449:9): [True: 1.14k, False: 0]
  ------------------
  450|  1.14k|        if (value < 0) {
  ------------------
  |  Branch (450:13): [True: 0, False: 1.14k]
  ------------------
  451|      0|            signvalue = '-';
  452|      0|            uvalue = 0 - (uint64_t)value;
  453|  1.14k|        } else if (flags & DP_F_PLUS)
  ------------------
  |  |   58|  1.14k|#define DP_F_PLUS       (1 << 1)
  ------------------
  |  Branch (453:20): [True: 0, False: 1.14k]
  ------------------
  454|      0|            signvalue = '+';
  455|  1.14k|        else if (flags & DP_F_SPACE)
  ------------------
  |  |   60|  1.14k|#define DP_F_SPACE      (1 << 2)
  ------------------
  |  Branch (455:18): [True: 0, False: 1.14k]
  ------------------
  456|      0|            signvalue = ' ';
  457|  1.14k|    }
  458|  1.14k|    if (flags & DP_F_NUM) {
  ------------------
  |  |   62|  1.14k|#define DP_F_NUM        (1 << 3)
  ------------------
  |  Branch (458:9): [True: 0, False: 1.14k]
  ------------------
  459|      0|        if (base == 8)
  ------------------
  |  Branch (459:13): [True: 0, False: 0]
  ------------------
  460|      0|            prefix = "0";
  461|      0|        if (base == 16)
  ------------------
  |  Branch (461:13): [True: 0, False: 0]
  ------------------
  462|      0|            prefix = "0x";
  463|      0|    }
  464|  1.14k|    if (flags & DP_F_UP)
  ------------------
  |  |   66|  1.14k|#define DP_F_UP         (1 << 5)
  ------------------
  |  Branch (464:9): [True: 0, False: 1.14k]
  ------------------
  465|      0|        caps = 1;
  466|  1.55k|    do {
  467|  1.55k|        convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
  ------------------
  |  Branch (467:29): [True: 0, False: 1.55k]
  ------------------
  468|  1.55k|            [uvalue % (unsigned)base];
  469|  1.55k|        uvalue = (uvalue / (unsigned)base);
  470|  1.55k|    } while (uvalue && (place < (int)sizeof(convert)));
  ------------------
  |  Branch (470:14): [True: 405, False: 1.14k]
  |  Branch (470:24): [True: 405, False: 0]
  ------------------
  471|  1.14k|    if (place == sizeof(convert))
  ------------------
  |  Branch (471:9): [True: 0, False: 1.14k]
  ------------------
  472|      0|        place--;
  473|  1.14k|    convert[place] = 0;
  474|       |
  475|  1.14k|    zpadlen = max - place;
  476|  1.14k|    spadlen =
  477|  1.14k|        min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - strlen(prefix);
  ------------------
  |  |   84|  1.14k|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 1.14k]
  |  |  ------------------
  ------------------
  |  Branch (477:39): [True: 0, False: 1.14k]
  ------------------
  478|  1.14k|    if (zpadlen < 0)
  ------------------
  |  Branch (478:9): [True: 1.14k, False: 0]
  ------------------
  479|  1.14k|        zpadlen = 0;
  480|  1.14k|    if (spadlen < 0)
  ------------------
  |  Branch (480:9): [True: 1.14k, False: 0]
  ------------------
  481|  1.14k|        spadlen = 0;
  482|  1.14k|    if (flags & DP_F_ZERO) {
  ------------------
  |  |   64|  1.14k|#define DP_F_ZERO       (1 << 4)
  ------------------
  |  Branch (482:9): [True: 0, False: 1.14k]
  ------------------
  483|      0|        zpadlen = OSSL_MAX(zpadlen, spadlen);
  ------------------
  |  |   84|      0|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  484|      0|        spadlen = 0;
  485|      0|    }
  486|  1.14k|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  1.14k|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (486:9): [True: 0, False: 1.14k]
  ------------------
  487|      0|        spadlen = -spadlen;
  488|       |
  489|       |    /* spaces */
  490|  1.14k|    while (spadlen > 0) {
  ------------------
  |  Branch (490:12): [True: 0, False: 1.14k]
  ------------------
  491|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (491:13): [True: 0, False: 0]
  ------------------
  492|      0|            return 0;
  493|      0|        --spadlen;
  494|      0|    }
  495|       |
  496|       |    /* sign */
  497|  1.14k|    if (signvalue)
  ------------------
  |  Branch (497:9): [True: 0, False: 1.14k]
  ------------------
  498|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
  ------------------
  |  Branch (498:13): [True: 0, False: 0]
  ------------------
  499|      0|            return 0;
  500|       |
  501|       |    /* prefix */
  502|  1.14k|    while (*prefix) {
  ------------------
  |  Branch (502:12): [True: 0, False: 1.14k]
  ------------------
  503|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix))
  ------------------
  |  Branch (503:13): [True: 0, False: 0]
  ------------------
  504|      0|            return 0;
  505|      0|        prefix++;
  506|      0|    }
  507|       |
  508|       |    /* zeros */
  509|  1.14k|    if (zpadlen > 0) {
  ------------------
  |  Branch (509:9): [True: 0, False: 1.14k]
  ------------------
  510|      0|        while (zpadlen > 0) {
  ------------------
  |  Branch (510:16): [True: 0, False: 0]
  ------------------
  511|      0|            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
  ------------------
  |  Branch (511:17): [True: 0, False: 0]
  ------------------
  512|      0|                return 0;
  513|      0|            --zpadlen;
  514|      0|        }
  515|      0|    }
  516|       |    /* digits */
  517|  2.70k|    while (place > 0) {
  ------------------
  |  Branch (517:12): [True: 1.55k, False: 1.14k]
  ------------------
  518|  1.55k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]))
  ------------------
  |  Branch (518:13): [True: 0, False: 1.55k]
  ------------------
  519|      0|            return 0;
  520|  1.55k|    }
  521|       |
  522|       |    /* left justified spaces */
  523|  1.14k|    while (spadlen < 0) {
  ------------------
  |  Branch (523:12): [True: 0, False: 1.14k]
  ------------------
  524|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (524:13): [True: 0, False: 0]
  ------------------
  525|      0|            return 0;
  526|      0|        ++spadlen;
  527|      0|    }
  528|  1.14k|    return 1;
  529|  1.14k|}
bio_print.c:fmtstr:
  384|  2.87k|{
  385|  2.87k|    int padlen;
  386|  2.87k|    size_t strln;
  387|  2.87k|    int cnt = 0;
  388|       |
  389|  2.87k|    if (value == 0)
  ------------------
  |  Branch (389:9): [True: 0, False: 2.87k]
  ------------------
  390|      0|        value = "<NULL>";
  391|       |
  392|  2.87k|    strln = OPENSSL_strnlen(value, max < 0 ? SIZE_MAX : (size_t)max);
  ------------------
  |  Branch (392:36): [True: 0, False: 2.87k]
  ------------------
  393|       |
  394|  2.87k|    padlen = min - strln;
  395|  2.87k|    if (min < 0 || padlen < 0)
  ------------------
  |  Branch (395:9): [True: 0, False: 2.87k]
  |  Branch (395:20): [True: 2.43k, False: 443]
  ------------------
  396|  2.43k|        padlen = 0;
  397|  2.87k|    if (max >= 0) {
  ------------------
  |  Branch (397:9): [True: 2.87k, False: 0]
  ------------------
  398|       |        /*
  399|       |         * Calculate the maximum output including padding.
  400|       |         * Make sure max doesn't overflow into negativity
  401|       |         */
  402|  2.87k|        if (max < INT_MAX - padlen)
  ------------------
  |  Branch (402:13): [True: 2.87k, False: 0]
  ------------------
  403|  2.87k|            max += padlen;
  404|      0|        else
  405|      0|            max = INT_MAX;
  406|  2.87k|    }
  407|  2.87k|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  2.87k|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (407:9): [True: 0, False: 2.87k]
  ------------------
  408|      0|        padlen = -padlen;
  409|       |
  410|  2.87k|    while ((padlen > 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (410:12): [True: 0, False: 2.87k]
  |  Branch (410:29): [True: 0, False: 0]
  |  Branch (410:40): [True: 0, False: 0]
  ------------------
  411|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (411:13): [True: 0, False: 0]
  ------------------
  412|      0|            return 0;
  413|      0|        --padlen;
  414|      0|        ++cnt;
  415|      0|    }
  416|  1.75M|    while (strln > 0 && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (416:12): [True: 1.75M, False: 2.87k]
  |  Branch (416:26): [True: 0, False: 1.75M]
  |  Branch (416:37): [True: 1.75M, False: 0]
  ------------------
  417|  1.75M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
  ------------------
  |  Branch (417:13): [True: 0, False: 1.75M]
  ------------------
  418|      0|            return 0;
  419|  1.75M|        --strln;
  420|  1.75M|        ++cnt;
  421|  1.75M|    }
  422|  2.87k|    while ((padlen < 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (422:12): [True: 0, False: 2.87k]
  |  Branch (422:29): [True: 0, False: 0]
  |  Branch (422:40): [True: 0, False: 0]
  ------------------
  423|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (423:13): [True: 0, False: 0]
  ------------------
  424|      0|            return 0;
  425|      0|        ++padlen;
  426|      0|        ++cnt;
  427|      0|    }
  428|  2.87k|    return 1;
  429|  2.87k|}

bio_sock_cleanup_int:
  166|      2|{
  167|       |# ifdef OPENSSL_SYS_WINDOWS
  168|       |    if (wsa_init_done) {
  169|       |        wsa_init_done = 0;
  170|       |        WSACleanup();
  171|       |    }
  172|       |# endif
  173|      2|}

BIO_new_file:
   58|  1.79k|{
   59|  1.79k|    BIO  *ret;
   60|  1.79k|    FILE *file = openssl_fopen(filename, mode);
   61|  1.79k|    int fp_flags = BIO_CLOSE;
  ------------------
  |  |   78|  1.79k|# define BIO_CLOSE               0x01
  ------------------
   62|       |
   63|  1.79k|    if (strchr(mode, 'b') == NULL)
  ------------------
  |  Branch (63:9): [True: 1.79k, False: 0]
  ------------------
   64|  1.79k|        fp_flags |= BIO_FP_TEXT;
  ------------------
  |  |  188|  1.79k|# define BIO_FP_TEXT             0x10
  ------------------
   65|       |
   66|  1.79k|    if (file == NULL) {
  ------------------
  |  Branch (66:9): [True: 1.53k, False: 258]
  ------------------
   67|  1.53k|        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  403|  1.53k|    (ERR_new(),                                                 \
  |  |  404|  1.53k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  267|  1.53k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  268|  1.53k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  288|  1.53k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|  1.53k|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   72|  1.53k|# define ERR_LIB_SYS             2
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|  1.53k|# define get_last_sys_error()    errno
  ------------------
   68|  1.53k|                       "calling fopen(%s, %s)",
   69|  1.53k|                       filename, mode);
   70|  1.53k|        if (errno == ENOENT
  ------------------
  |  Branch (70:13): [True: 0, False: 1.53k]
  ------------------
   71|  1.53k|#ifdef ENXIO
   72|  1.53k|            || errno == ENXIO
  ------------------
  |  Branch (72:16): [True: 0, False: 1.53k]
  ------------------
   73|  1.53k|#endif
   74|  1.53k|            )
   75|  1.53k|            ERR_raise(ERR_LIB_BIO, BIO_R_NO_SUCH_FILE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   76|  1.53k|        else
   77|  1.53k|            ERR_raise(ERR_LIB_BIO, ERR_R_SYS_LIB);
  ------------------
  |  |  401|  1.53k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.53k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.53k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|  1.53k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|  1.53k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|  1.53k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.53k|     ERR_set_error)
  |  |  ------------------
  ------------------
   78|  1.53k|        return NULL;
   79|  1.53k|    }
   80|    258|    if ((ret = BIO_new(BIO_s_file())) == NULL) {
  ------------------
  |  Branch (80:9): [True: 0, False: 258]
  ------------------
   81|      0|        fclose(file);
   82|      0|        return NULL;
   83|      0|    }
   84|       |
   85|       |    /* we did fopen -> we disengage UPLINK */
   86|    258|    BIO_clear_flags(ret, BIO_FLAGS_UPLINK_INTERNAL);
  ------------------
  |  |   21|    258|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
   87|    258|    BIO_set_fp(ret, file, fp_flags);
  ------------------
  |  |  491|    258|# define BIO_set_fp(b,fp,c)      BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)(fp))
  |  |  ------------------
  |  |  |  |  375|    258|# define BIO_C_SET_FILE_PTR                      106
  |  |  ------------------
  ------------------
   88|    258|    return ret;
   89|    258|}
BIO_s_file:
  105|    258|{
  106|    258|    return &methods_filep;
  107|    258|}
bss_file.c:file_gets:
  348|  9.56k|{
  349|  9.56k|    int ret = 0;
  350|       |
  351|  9.56k|    buf[0] = '\0';
  352|  9.56k|    if (bp->flags & BIO_FLAGS_UPLINK_INTERNAL) {
  ------------------
  |  |   21|  9.56k|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  |  Branch (352:9): [True: 0, False: 9.56k]
  ------------------
  353|      0|        if (!UP_fgets(buf, size, bp->ptr))
  ------------------
  |  |  164|      0|# define UP_fgets        fgets
  ------------------
  |  Branch (353:13): [True: 0, False: 0]
  ------------------
  354|      0|            goto err;
  355|  9.56k|    } else {
  356|  9.56k|        if (!fgets(buf, size, (FILE *)bp->ptr))
  ------------------
  |  Branch (356:13): [True: 197, False: 9.36k]
  ------------------
  357|    197|            goto err;
  358|  9.56k|    }
  359|  9.36k|    if (buf[0] != '\0')
  ------------------
  |  Branch (359:9): [True: 9.35k, False: 6]
  ------------------
  360|  9.35k|        ret = strlen(buf);
  361|  9.56k| err:
  362|  9.56k|    return ret;
  363|  9.36k|}
bss_file.c:file_ctrl:
  179|    258|{
  180|    258|    long ret = 1;
  181|    258|    FILE *fp = (FILE *)b->ptr;
  182|    258|    FILE **fpp;
  183|    258|    char p[4];
  184|    258|    int st;
  185|       |
  186|    258|    switch (cmd) {
  187|      0|    case BIO_C_FILE_SEEK:
  ------------------
  |  |  397|      0|# define BIO_C_FILE_SEEK                         128
  ------------------
  |  Branch (187:5): [True: 0, False: 258]
  ------------------
  188|      0|    case BIO_CTRL_RESET:
  ------------------
  |  |   83|      0|# define BIO_CTRL_RESET          1/* opt - rewind/zero etc */
  ------------------
  |  Branch (188:5): [True: 0, False: 258]
  ------------------
  189|      0|        if (b->flags & BIO_FLAGS_UPLINK_INTERNAL)
  ------------------
  |  |   21|      0|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  |  Branch (189:13): [True: 0, False: 0]
  ------------------
  190|      0|            ret = (long)UP_fseek(b->ptr, num, 0);
  ------------------
  |  |  172|      0|# define UP_fseek        fseek
  ------------------
  191|      0|        else
  192|      0|            ret = (long)fseek(fp, num, 0);
  193|      0|        break;
  194|      0|    case BIO_CTRL_EOF:
  ------------------
  |  |   84|      0|# define BIO_CTRL_EOF            2/* opt - are we at the eof */
  ------------------
  |  Branch (194:5): [True: 0, False: 258]
  ------------------
  195|      0|        if (b->flags & BIO_FLAGS_UPLINK_INTERNAL)
  ------------------
  |  |   21|      0|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  |  Branch (195:13): [True: 0, False: 0]
  ------------------
  196|      0|            ret = (long)UP_feof(fp);
  ------------------
  |  |  168|      0|# define UP_feof         feof
  ------------------
  197|      0|        else
  198|      0|            ret = (long)feof(fp);
  199|      0|        break;
  200|      0|    case BIO_C_FILE_TELL:
  ------------------
  |  |  403|      0|# define BIO_C_FILE_TELL                         133
  ------------------
  |  Branch (200:5): [True: 0, False: 258]
  ------------------
  201|      0|    case BIO_CTRL_INFO:
  ------------------
  |  |   85|      0|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  ------------------
  |  Branch (201:5): [True: 0, False: 258]
  ------------------
  202|      0|        if (b->flags & BIO_FLAGS_UPLINK_INTERNAL)
  ------------------
  |  |   21|      0|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  |  Branch (202:13): [True: 0, False: 0]
  ------------------
  203|      0|            ret = UP_ftell(b->ptr);
  ------------------
  |  |  173|      0|# define UP_ftell        ftell
  ------------------
  204|      0|        else
  205|      0|            ret = ftell(fp);
  206|      0|        break;
  207|    258|    case BIO_C_SET_FILE_PTR:
  ------------------
  |  |  375|    258|# define BIO_C_SET_FILE_PTR                      106
  ------------------
  |  Branch (207:5): [True: 258, False: 0]
  ------------------
  208|    258|        file_free(b);
  209|    258|        b->shutdown = (int)num & BIO_CLOSE;
  ------------------
  |  |   78|    258|# define BIO_CLOSE               0x01
  ------------------
  210|    258|        b->ptr = ptr;
  211|    258|        b->init = 1;
  212|       |# if BIO_FLAGS_UPLINK_INTERNAL!=0
  213|       |#  if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES)
  214|       |#   define _IOB_ENTRIES 20
  215|       |#  endif
  216|       |        /* Safety net to catch purely internal BIO_set_fp calls */
  217|       |#  if (defined(_MSC_VER) && _MSC_VER>=1900) || defined(__BORLANDC__)
  218|       |        if (ptr == stdin || ptr == stdout || ptr == stderr)
  219|       |            BIO_clear_flags(b, BIO_FLAGS_UPLINK_INTERNAL);
  220|       |#  elif defined(_IOB_ENTRIES)
  221|       |        if ((size_t)ptr >= (size_t)stdin &&
  222|       |            (size_t)ptr < (size_t)(stdin + _IOB_ENTRIES))
  223|       |            BIO_clear_flags(b, BIO_FLAGS_UPLINK_INTERNAL);
  224|       |#  endif
  225|       |# endif
  226|       |# ifdef UP_fsetmod
  227|       |        if (b->flags & BIO_FLAGS_UPLINK_INTERNAL)
  228|       |            UP_fsetmod(b->ptr, (char)((num & BIO_FP_TEXT) ? 't' : 'b'));
  229|       |        else
  230|       |# endif
  231|    258|        {
  232|       |# if defined(OPENSSL_SYS_WINDOWS)
  233|       |            int fd = _fileno((FILE *)ptr);
  234|       |            if (num & BIO_FP_TEXT)
  235|       |                _setmode(fd, _O_TEXT);
  236|       |            else
  237|       |                _setmode(fd, _O_BINARY);
  238|       |            /*
  239|       |             * Reports show that ftell() isn't trustable in text mode.
  240|       |             * This has been confirmed as a bug in the Universal C RTL, see
  241|       |             * https://developercommunity.visualstudio.com/content/problem/425878/fseek-ftell-fail-in-text-mode-for-unix-style-text.html
  242|       |             * The suggested work-around from Microsoft engineering is to
  243|       |             * turn off buffering until the bug is resolved.
  244|       |             */
  245|       |            if ((num & BIO_FP_TEXT) != 0)
  246|       |                setvbuf((FILE *)ptr, NULL, _IONBF, 0);
  247|       |# elif defined(OPENSSL_SYS_MSDOS)
  248|       |            int fd = fileno((FILE *)ptr);
  249|       |            /* Set correct text/binary mode */
  250|       |            if (num & BIO_FP_TEXT)
  251|       |                _setmode(fd, _O_TEXT);
  252|       |            /* Dangerous to set stdin/stdout to raw (unless redirected) */
  253|       |            else {
  254|       |                if (fd == STDIN_FILENO || fd == STDOUT_FILENO) {
  255|       |                    if (isatty(fd) <= 0)
  256|       |                        _setmode(fd, _O_BINARY);
  257|       |                } else
  258|       |                    _setmode(fd, _O_BINARY);
  259|       |            }
  260|       |# elif defined(OPENSSL_SYS_WIN32_CYGWIN)
  261|       |            int fd = fileno((FILE *)ptr);
  262|       |            if (!(num & BIO_FP_TEXT))
  263|       |                setmode(fd, O_BINARY);
  264|       |# endif
  265|    258|        }
  266|    258|        break;
  267|      0|    case BIO_C_SET_FILENAME:
  ------------------
  |  |  377|      0|# define BIO_C_SET_FILENAME                      108
  ------------------
  |  Branch (267:5): [True: 0, False: 258]
  ------------------
  268|      0|        file_free(b);
  269|      0|        b->shutdown = (int)num & BIO_CLOSE;
  ------------------
  |  |   78|      0|# define BIO_CLOSE               0x01
  ------------------
  270|      0|        if (num & BIO_FP_APPEND) {
  ------------------
  |  |  187|      0|# define BIO_FP_APPEND           0x08
  ------------------
  |  Branch (270:13): [True: 0, False: 0]
  ------------------
  271|      0|            if (num & BIO_FP_READ)
  ------------------
  |  |  185|      0|# define BIO_FP_READ             0x02
  ------------------
  |  Branch (271:17): [True: 0, False: 0]
  ------------------
  272|      0|                OPENSSL_strlcpy(p, "a+", sizeof(p));
  273|      0|            else
  274|      0|                OPENSSL_strlcpy(p, "a", sizeof(p));
  275|      0|        } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
  ------------------
  |  |  185|      0|# define BIO_FP_READ             0x02
  ------------------
                      } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
  ------------------
  |  |  186|      0|# define BIO_FP_WRITE            0x04
  ------------------
  |  Branch (275:20): [True: 0, False: 0]
  |  Branch (275:43): [True: 0, False: 0]
  ------------------
  276|      0|            OPENSSL_strlcpy(p, "r+", sizeof(p));
  277|      0|        else if (num & BIO_FP_WRITE)
  ------------------
  |  |  186|      0|# define BIO_FP_WRITE            0x04
  ------------------
  |  Branch (277:18): [True: 0, False: 0]
  ------------------
  278|      0|            OPENSSL_strlcpy(p, "w", sizeof(p));
  279|      0|        else if (num & BIO_FP_READ)
  ------------------
  |  |  185|      0|# define BIO_FP_READ             0x02
  ------------------
  |  Branch (279:18): [True: 0, False: 0]
  ------------------
  280|      0|            OPENSSL_strlcpy(p, "r", sizeof(p));
  281|      0|        else {
  282|      0|            ERR_raise(ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  283|      0|            ret = 0;
  284|      0|            break;
  285|      0|        }
  286|       |# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS)
  287|       |        if (!(num & BIO_FP_TEXT))
  288|       |            OPENSSL_strlcat(p, "b", sizeof(p));
  289|       |        else
  290|       |            OPENSSL_strlcat(p, "t", sizeof(p));
  291|       |# elif defined(OPENSSL_SYS_WIN32_CYGWIN)
  292|       |        if (!(num & BIO_FP_TEXT))
  293|       |            OPENSSL_strlcat(p, "b", sizeof(p));
  294|       |# endif
  295|      0|        fp = openssl_fopen(ptr, p);
  296|      0|        if (fp == NULL) {
  ------------------
  |  Branch (296:13): [True: 0, False: 0]
  ------------------
  297|      0|            ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
                          ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      0|# define get_last_sys_error()    errno
  ------------------
  298|      0|                           "calling fopen(%s, %s)",
  299|      0|                           ptr, p);
  300|      0|            ERR_raise(ERR_LIB_BIO, ERR_R_SYS_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  301|      0|            ret = 0;
  302|      0|            break;
  303|      0|        }
  304|      0|        b->ptr = fp;
  305|      0|        b->init = 1;
  306|       |        /* we did fopen -> we disengage UPLINK */
  307|      0|        BIO_clear_flags(b, BIO_FLAGS_UPLINK_INTERNAL);
  ------------------
  |  |   21|      0|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  308|      0|        break;
  309|      0|    case BIO_C_GET_FILE_PTR:
  ------------------
  |  |  376|      0|# define BIO_C_GET_FILE_PTR                      107
  ------------------
  |  Branch (309:5): [True: 0, False: 258]
  ------------------
  310|       |        /* the ptr parameter is actually a FILE ** in this case. */
  311|      0|        if (ptr != NULL) {
  ------------------
  |  Branch (311:13): [True: 0, False: 0]
  ------------------
  312|      0|            fpp = (FILE **)ptr;
  313|      0|            *fpp = (FILE *)b->ptr;
  314|      0|        }
  315|      0|        break;
  316|      0|    case BIO_CTRL_GET_CLOSE:
  ------------------
  |  |   90|      0|# define BIO_CTRL_GET_CLOSE      8/* man - set the 'close' on free */
  ------------------
  |  Branch (316:5): [True: 0, False: 258]
  ------------------
  317|      0|        ret = (long)b->shutdown;
  318|      0|        break;
  319|      0|    case BIO_CTRL_SET_CLOSE:
  ------------------
  |  |   91|      0|# define BIO_CTRL_SET_CLOSE      9/* man - set the 'close' on free */
  ------------------
  |  Branch (319:5): [True: 0, False: 258]
  ------------------
  320|      0|        b->shutdown = (int)num;
  321|      0|        break;
  322|      0|    case BIO_CTRL_FLUSH:
  ------------------
  |  |   93|      0|# define BIO_CTRL_FLUSH          11/* opt - 'flush' buffered output */
  ------------------
  |  Branch (322:5): [True: 0, False: 258]
  ------------------
  323|      0|        st = b->flags & BIO_FLAGS_UPLINK_INTERNAL
  ------------------
  |  |   21|      0|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  |  Branch (323:14): [True: 0, False: 0]
  ------------------
  324|      0|                ? UP_fflush(b->ptr) : fflush((FILE *)b->ptr);
  ------------------
  |  |  174|      0|# define UP_fflush       fflush
  ------------------
  325|      0|        if (st == EOF) {
  ------------------
  |  Branch (325:13): [True: 0, False: 0]
  ------------------
  326|      0|            ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
                          ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      0|# define get_last_sys_error()    errno
  ------------------
  327|      0|                           "calling fflush()");
  328|      0|            ERR_raise(ERR_LIB_BIO, ERR_R_SYS_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  329|      0|            ret = 0;
  330|      0|        }
  331|      0|        break;
  332|      0|    case BIO_CTRL_DUP:
  ------------------
  |  |   94|      0|# define BIO_CTRL_DUP            12/* man - extra stuff for 'duped' BIO */
  ------------------
  |  Branch (332:5): [True: 0, False: 258]
  ------------------
  333|      0|        ret = 1;
  334|      0|        break;
  335|       |
  336|      0|    case BIO_CTRL_WPENDING:
  ------------------
  |  |   95|      0|# define BIO_CTRL_WPENDING       13/* opt - number of bytes still to write */
  ------------------
  |  Branch (336:5): [True: 0, False: 258]
  ------------------
  337|      0|    case BIO_CTRL_PENDING:
  ------------------
  |  |   92|      0|# define BIO_CTRL_PENDING        10/* opt - is their more data buffered */
  ------------------
  |  Branch (337:5): [True: 0, False: 258]
  ------------------
  338|      0|    case BIO_CTRL_PUSH:
  ------------------
  |  |   88|      0|# define BIO_CTRL_PUSH           6/* opt - internal, used to signify change */
  ------------------
  |  Branch (338:5): [True: 0, False: 258]
  ------------------
  339|      0|    case BIO_CTRL_POP:
  ------------------
  |  |   89|      0|# define BIO_CTRL_POP            7/* opt - internal, used to signify change */
  ------------------
  |  Branch (339:5): [True: 0, False: 258]
  ------------------
  340|      0|    default:
  ------------------
  |  Branch (340:5): [True: 0, False: 258]
  ------------------
  341|      0|        ret = 0;
  342|      0|        break;
  343|    258|    }
  344|    258|    return ret;
  345|    258|}
bss_file.c:file_new:
  110|    258|{
  111|    258|    bi->init = 0;
  112|    258|    bi->num = 0;
  113|    258|    bi->ptr = NULL;
  114|    258|    bi->flags = BIO_FLAGS_UPLINK_INTERNAL; /* default to UPLINK */
  ------------------
  |  |   21|    258|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  115|    258|    return 1;
  116|    258|}
bss_file.c:file_free:
  119|    516|{
  120|    516|    if (a == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 516]
  ------------------
  121|      0|        return 0;
  122|    516|    if (a->shutdown) {
  ------------------
  |  Branch (122:9): [True: 516, False: 0]
  ------------------
  123|    516|        if ((a->init) && (a->ptr != NULL)) {
  ------------------
  |  Branch (123:13): [True: 258, False: 258]
  |  Branch (123:26): [True: 258, False: 0]
  ------------------
  124|    258|            if (a->flags & BIO_FLAGS_UPLINK_INTERNAL)
  ------------------
  |  |   21|    258|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  |  Branch (124:17): [True: 0, False: 258]
  ------------------
  125|      0|                UP_fclose(a->ptr);
  ------------------
  |  |  169|      0|# define UP_fclose       fclose
  ------------------
  126|    258|            else
  127|    258|                fclose(a->ptr);
  128|    258|            a->ptr = NULL;
  129|    258|            a->flags = BIO_FLAGS_UPLINK_INTERNAL;
  ------------------
  |  |   21|    258|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  130|    258|        }
  131|    516|        a->init = 0;
  132|    516|    }
  133|    516|    return 1;
  134|    516|}

BIO_s_mem:
   73|  3.13k|{
   74|  3.13k|    return &mem_method;
   75|  3.13k|}
bss_mem.c:mem_write:
  215|  3.13k|{
  216|  3.13k|    int ret = -1;
  217|  3.13k|    int blen;
  218|  3.13k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  219|       |
  220|  3.13k|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  207|  3.13k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (220:9): [True: 0, False: 3.13k]
  ------------------
  221|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  222|      0|        goto end;
  223|      0|    }
  224|  3.13k|    BIO_clear_retry_flags(b);
  ------------------
  |  |  231|  3.13k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  193|  3.13k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  190|  3.13k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  191|  3.13k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|  3.13k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  194|  3.13k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  225|  3.13k|    if (inl == 0)
  ------------------
  |  Branch (225:9): [True: 0, False: 3.13k]
  ------------------
  226|      0|        return 0;
  227|  3.13k|    if (in == NULL) {
  ------------------
  |  Branch (227:9): [True: 0, False: 3.13k]
  ------------------
  228|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        goto end;
  230|      0|    }
  231|  3.13k|    blen = bbm->readp->length;
  232|  3.13k|    mem_buf_sync(b);
  233|  3.13k|    if (BUF_MEM_grow_clean(bbm->buf, blen + inl) == 0)
  ------------------
  |  Branch (233:9): [True: 0, False: 3.13k]
  ------------------
  234|      0|        goto end;
  235|  3.13k|    memcpy(bbm->buf->data + blen, in, inl);
  236|  3.13k|    *bbm->readp = *bbm->buf;
  237|  3.13k|    ret = inl;
  238|  3.13k| end:
  239|  3.13k|    return ret;
  240|  3.13k|}
bss_mem.c:mem_buf_sync:
  178|  3.13k|{
  179|  3.13k|    if (b != NULL && b->init != 0 && b->ptr != NULL) {
  ------------------
  |  Branch (179:9): [True: 3.13k, False: 0]
  |  Branch (179:22): [True: 3.13k, False: 0]
  |  Branch (179:38): [True: 3.13k, False: 0]
  ------------------
  180|  3.13k|        BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  181|       |
  182|  3.13k|        if (bbm->readp->data != bbm->buf->data) {
  ------------------
  |  Branch (182:13): [True: 0, False: 3.13k]
  ------------------
  183|      0|            memmove(bbm->buf->data, bbm->readp->data, bbm->readp->length);
  184|      0|            bbm->buf->length = bbm->readp->length;
  185|      0|            bbm->readp->data = bbm->buf->data;
  186|      0|        }
  187|  3.13k|    }
  188|  3.13k|    return 0;
  189|  3.13k|}
bss_mem.c:mem_read:
  192|  6.79M|{
  193|  6.79M|    int ret = -1;
  194|  6.79M|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  195|  6.79M|    BUF_MEM *bm = bbm->readp;
  196|       |
  197|  6.79M|    if (b->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  207|  6.79M|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (197:9): [True: 0, False: 6.79M]
  ------------------
  198|      0|        bm = bbm->buf;
  199|  6.79M|    BIO_clear_retry_flags(b);
  ------------------
  |  |  231|  6.79M|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  193|  6.79M|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  190|  6.79M|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  191|  6.79M|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|  6.79M|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  194|  6.79M|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  200|  6.79M|    ret = (outl >= 0 && (size_t)outl > bm->length) ? (int)bm->length : outl;
  ------------------
  |  Branch (200:12): [True: 6.79M, False: 0]
  |  Branch (200:25): [True: 0, False: 6.79M]
  ------------------
  201|  6.79M|    if ((out != NULL) && (ret > 0)) {
  ------------------
  |  Branch (201:9): [True: 6.79M, False: 0]
  |  Branch (201:26): [True: 6.79M, False: 0]
  ------------------
  202|  6.79M|        memcpy(out, bm->data, ret);
  203|  6.79M|        bm->length -= ret;
  204|  6.79M|        bm->max -= ret;
  205|  6.79M|        bm->data += ret;
  206|  6.79M|    } else if (bm->length == 0) {
  ------------------
  |  Branch (206:16): [True: 0, False: 0]
  ------------------
  207|      0|        ret = b->num;
  208|      0|        if (ret != 0)
  ------------------
  |  Branch (208:13): [True: 0, False: 0]
  ------------------
  209|      0|            BIO_set_retry_read(b);
  ------------------
  |  |  225|      0|                BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  190|      0|# define BIO_FLAGS_READ          0x01
  |  |  ------------------
  |  |                               BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  194|      0|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  210|      0|    }
  211|  6.79M|    return ret;
  212|  6.79M|}
bss_mem.c:mem_gets:
  342|  6.79M|{
  343|  6.79M|    int i, j;
  344|  6.79M|    int ret = -1;
  345|  6.79M|    char *p;
  346|  6.79M|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)bp->ptr;
  347|  6.79M|    BUF_MEM *bm = bbm->readp;
  348|       |
  349|  6.79M|    if (bp->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  207|  6.79M|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (349:9): [True: 0, False: 6.79M]
  ------------------
  350|      0|        bm = bbm->buf;
  351|  6.79M|    BIO_clear_retry_flags(bp);
  ------------------
  |  |  231|  6.79M|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  193|  6.79M|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  190|  6.79M|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  191|  6.79M|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  192|  6.79M|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  194|  6.79M|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  352|  6.79M|    j = bm->length;
  353|  6.79M|    if ((size - 1) < j)
  ------------------
  |  Branch (353:9): [True: 6.74M, False: 52.0k]
  ------------------
  354|  6.74M|        j = size - 1;
  355|  6.79M|    if (j <= 0) {
  ------------------
  |  Branch (355:9): [True: 4.96k, False: 6.79M]
  ------------------
  356|  4.96k|        *buf = '\0';
  357|  4.96k|        return 0;
  358|  4.96k|    }
  359|  6.79M|    p = bm->data;
  360|  45.9M|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (360:17): [True: 45.8M, False: 78.4k]
  ------------------
  361|  45.8M|        if (p[i] == '\n') {
  ------------------
  |  Branch (361:13): [True: 6.71M, False: 39.1M]
  ------------------
  362|  6.71M|            i++;
  363|  6.71M|            break;
  364|  6.71M|        }
  365|  45.8M|    }
  366|       |
  367|       |    /*
  368|       |     * i is now the max num of bytes to copy, either j or up to
  369|       |     * and including the first newline
  370|       |     */
  371|       |
  372|  6.79M|    i = mem_read(bp, buf, i);
  373|  6.79M|    if (i > 0)
  ------------------
  |  Branch (373:9): [True: 6.79M, False: 0]
  ------------------
  374|  6.79M|        buf[i] = '\0';
  375|  6.79M|    ret = i;
  376|  6.79M|    return ret;
  377|  6.79M|}
bss_mem.c:mem_buf_free:
  158|  3.13k|{
  159|  3.13k|    if (a == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 3.13k]
  ------------------
  160|      0|        return 0;
  161|       |
  162|  3.13k|    if (a->shutdown && a->init && a->ptr != NULL) {
  ------------------
  |  Branch (162:9): [True: 3.13k, False: 0]
  |  Branch (162:24): [True: 3.13k, False: 0]
  |  Branch (162:35): [True: 3.13k, False: 0]
  ------------------
  163|  3.13k|        BIO_BUF_MEM *bb = (BIO_BUF_MEM *)a->ptr;
  164|  3.13k|        BUF_MEM *b = bb->buf;
  165|       |
  166|  3.13k|        if (a->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  207|  3.13k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (166:13): [True: 0, False: 3.13k]
  ------------------
  167|      0|            b->data = NULL;
  168|  3.13k|        BUF_MEM_free(b);
  169|  3.13k|    }
  170|  3.13k|    return 1;
  171|  3.13k|}
bss_mem.c:mem_new:
  133|  3.13k|{
  134|  3.13k|    return mem_init(bi, 0L);
  135|  3.13k|}
bss_mem.c:mem_init:
  110|  3.13k|{
  111|  3.13k|    BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));
  ------------------
  |  |   98|  3.13k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|       |
  113|  3.13k|    if (bb == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 3.13k]
  ------------------
  114|      0|        return 0;
  115|  3.13k|    if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 3.13k]
  ------------------
  116|      0|        OPENSSL_free(bb);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  117|      0|        return 0;
  118|      0|    }
  119|  3.13k|    if ((bb->readp = OPENSSL_zalloc(sizeof(*bb->readp))) == NULL) {
  ------------------
  |  |   98|  3.13k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 3.13k]
  ------------------
  120|      0|        BUF_MEM_free(bb->buf);
  121|      0|        OPENSSL_free(bb);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  122|      0|        return 0;
  123|      0|    }
  124|  3.13k|    *bb->readp = *bb->buf;
  125|  3.13k|    bi->shutdown = 1;
  126|  3.13k|    bi->init = 1;
  127|  3.13k|    bi->num = -1;
  128|  3.13k|    bi->ptr = (char *)bb;
  129|  3.13k|    return 1;
  130|  3.13k|}
bss_mem.c:mem_free:
  143|  3.13k|{
  144|  3.13k|    BIO_BUF_MEM *bb;
  145|       |
  146|  3.13k|    if (a == NULL)
  ------------------
  |  Branch (146:9): [True: 0, False: 3.13k]
  ------------------
  147|      0|        return 0;
  148|       |
  149|  3.13k|    bb = (BIO_BUF_MEM *)a->ptr;
  150|  3.13k|    if (!mem_buf_free(a))
  ------------------
  |  Branch (150:9): [True: 0, False: 3.13k]
  ------------------
  151|      0|        return 0;
  152|  3.13k|    OPENSSL_free(bb->readp);
  ------------------
  |  |  106|  3.13k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  153|  3.13k|    OPENSSL_free(bb);
  ------------------
  |  |  106|  3.13k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|  3.13k|    return 1;
  155|  3.13k|}

ossl_err_load_BN_strings:
   50|      2|{
   51|      2|#ifndef OPENSSL_NO_ERR
   52|      2|    if (ERR_reason_error_string(BN_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 2, False: 0]
  ------------------
   53|      2|        ERR_load_strings_const(BN_str_reasons);
   54|      2|#endif
   55|      2|    return 1;
   56|      2|}

ossl_err_load_BUF_strings:
   24|      2|{
   25|      2|#ifndef OPENSSL_NO_ERR
   26|      2|    if (ERR_reason_error_string(BUF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (26:9): [True: 2, False: 0]
  ------------------
   27|      2|        ERR_load_strings_const(BUF_str_reasons);
   28|      2|#endif
   29|      2|    return 1;
   30|      2|}

BUF_MEM_new_ex:
   22|  3.13k|{
   23|  3.13k|    BUF_MEM *ret;
   24|       |
   25|  3.13k|    ret = BUF_MEM_new();
   26|  3.13k|    if (ret != NULL)
  ------------------
  |  Branch (26:9): [True: 3.13k, False: 0]
  ------------------
   27|  3.13k|        ret->flags = flags;
   28|  3.13k|    return ret;
   29|  3.13k|}
BUF_MEM_new:
   32|  37.8k|{
   33|  37.8k|    BUF_MEM *ret;
   34|       |
   35|  37.8k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   98|  37.8k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  37.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  37.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|  37.8k|    if (ret == NULL) {
  ------------------
  |  Branch (36:9): [True: 0, False: 37.8k]
  ------------------
   37|      0|        ERR_raise(ERR_LIB_BUF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|  37.8k|    return ret;
   41|  37.8k|}
BUF_MEM_free:
   44|  6.50k|{
   45|  6.50k|    if (a == NULL)
  ------------------
  |  Branch (45:9): [True: 0, False: 6.50k]
  ------------------
   46|      0|        return;
   47|  6.50k|    if (a->data != NULL) {
  ------------------
  |  Branch (47:9): [True: 6.50k, False: 0]
  ------------------
   48|  6.50k|        if (a->flags & BUF_MEM_FLAG_SECURE)
  ------------------
  |  |   49|  6.50k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (48:13): [True: 0, False: 6.50k]
  ------------------
   49|      0|            OPENSSL_secure_clear_free(a->data, a->max);
  ------------------
  |  |  120|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   50|  6.50k|        else
   51|  6.50k|            OPENSSL_clear_free(a->data, a->max);
  ------------------
  |  |  104|  6.50k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  6.50k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  6.50k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|  6.50k|    }
   53|  6.50k|    OPENSSL_free(a);
  ------------------
  |  |  106|  6.50k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  6.50k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  6.50k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   54|  6.50k|}
BUF_MEM_grow:
   74|  6.83M|{
   75|  6.83M|    char *ret;
   76|  6.83M|    size_t n;
   77|       |
   78|  6.83M|    if (str->length >= len) {
  ------------------
  |  Branch (78:9): [True: 6.72M, False: 115k]
  ------------------
   79|  6.72M|        str->length = len;
   80|  6.72M|        return len;
   81|  6.72M|    }
   82|   115k|    if (str->max >= len) {
  ------------------
  |  Branch (82:9): [True: 78.4k, False: 37.4k]
  ------------------
   83|  78.4k|        if (str->data != NULL)
  ------------------
  |  Branch (83:13): [True: 78.4k, False: 0]
  ------------------
   84|  78.4k|            memset(&str->data[str->length], 0, len - str->length);
   85|  78.4k|        str->length = len;
   86|  78.4k|        return len;
   87|  78.4k|    }
   88|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
   89|  37.4k|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|  37.4k|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (89:9): [True: 0, False: 37.4k]
  ------------------
   90|      0|        ERR_raise(ERR_LIB_BUF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   91|      0|        return 0;
   92|      0|    }
   93|  37.4k|    n = (len + 3) / 3 * 4;
   94|  37.4k|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   49|  37.4k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (94:9): [True: 0, False: 37.4k]
  ------------------
   95|      0|        ret = sec_alloc_realloc(str, n);
   96|  37.4k|    else
   97|  37.4k|        ret = OPENSSL_realloc(str->data, n);
  ------------------
  |  |  100|  37.4k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  37.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  37.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   98|  37.4k|    if (ret == NULL) {
  ------------------
  |  Branch (98:9): [True: 0, False: 37.4k]
  ------------------
   99|      0|        ERR_raise(ERR_LIB_BUF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  100|      0|        len = 0;
  101|  37.4k|    } else {
  102|  37.4k|        str->data = ret;
  103|  37.4k|        str->max = n;
  104|  37.4k|        memset(&str->data[str->length], 0, len - str->length);
  105|  37.4k|        str->length = len;
  106|  37.4k|    }
  107|  37.4k|    return len;
  108|  37.4k|}
BUF_MEM_grow_clean:
  111|  12.8k|{
  112|  12.8k|    char *ret;
  113|  12.8k|    size_t n;
  114|       |
  115|  12.8k|    if (str->length >= len) {
  ------------------
  |  Branch (115:9): [True: 4.90k, False: 7.91k]
  ------------------
  116|  4.90k|        if (str->data != NULL)
  ------------------
  |  Branch (116:13): [True: 4.90k, False: 0]
  ------------------
  117|  4.90k|            memset(&str->data[len], 0, str->length - len);
  118|  4.90k|        str->length = len;
  119|  4.90k|        return len;
  120|  4.90k|    }
  121|  7.91k|    if (str->max >= len) {
  ------------------
  |  Branch (121:9): [True: 1.79k, False: 6.12k]
  ------------------
  122|  1.79k|        memset(&str->data[str->length], 0, len - str->length);
  123|  1.79k|        str->length = len;
  124|  1.79k|        return len;
  125|  1.79k|    }
  126|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
  127|  6.12k|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|  6.12k|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (127:9): [True: 0, False: 6.12k]
  ------------------
  128|      0|        ERR_raise(ERR_LIB_BUF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  129|      0|        return 0;
  130|      0|    }
  131|  6.12k|    n = (len + 3) / 3 * 4;
  132|  6.12k|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   49|  6.12k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (132:9): [True: 0, False: 6.12k]
  ------------------
  133|      0|        ret = sec_alloc_realloc(str, n);
  134|  6.12k|    else
  135|  6.12k|        ret = OPENSSL_clear_realloc(str->data, str->max, n);
  ------------------
  |  |  102|  6.12k|        CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  6.12k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  6.12k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|  6.12k|    if (ret == NULL) {
  ------------------
  |  Branch (136:9): [True: 0, False: 6.12k]
  ------------------
  137|      0|        ERR_raise(ERR_LIB_BUF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  138|      0|        len = 0;
  139|  6.12k|    } else {
  140|  6.12k|        str->data = ret;
  141|  6.12k|        str->max = n;
  142|  6.12k|        memset(&str->data[str->length], 0, len - str->length);
  143|  6.12k|        str->length = len;
  144|  6.12k|    }
  145|  6.12k|    return len;
  146|  6.12k|}

ossl_err_load_CMP_strings:
  172|      2|{
  173|      2|# ifndef OPENSSL_NO_ERR
  174|      2|    if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (174:9): [True: 2, False: 0]
  ------------------
  175|      2|        ERR_load_strings_const(CMP_str_reasons);
  176|      2|# endif
  177|      2|    return 1;
  178|      2|}

OSSL_CMP_log_close:
   41|      2|{
   42|      2|    (void)OSSL_trace_set_channel(OSSL_TRACE_CATEGORY_CMP, NULL);
  ------------------
  |  |   53|      2|# define OSSL_TRACE_CATEGORY_CMP                13
  ------------------
   43|      2|}

ossl_err_load_CMS_strings:
  169|      2|{
  170|      2|# ifndef OPENSSL_NO_ERR
  171|      2|    if (ERR_reason_error_string(CMS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (171:9): [True: 2, False: 0]
  ------------------
  172|      2|        ERR_load_strings_const(CMS_str_reasons);
  173|      2|# endif
  174|      2|    return 1;
  175|      2|}

ossl_comp_zlib_cleanup:
  260|      2|{
  261|       |#ifdef ZLIB_SHARED
  262|       |    DSO_free(zlib_dso);
  263|       |    zlib_dso = NULL;
  264|       |#endif
  265|      2|}

ossl_err_load_COMP_strings:
   32|      2|{
   33|      2|# ifndef OPENSSL_NO_ERR
   34|      2|    if (ERR_reason_error_string(COMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (34:9): [True: 2, False: 0]
  ------------------
   35|      2|        ERR_load_strings_const(COMP_str_reasons);
   36|      2|# endif
   37|      2|    return 1;
   38|      2|}

_CONF_get_section:
   24|  13.7k|{
   25|  13.7k|    CONF_VALUE vv;
   26|       |
   27|  13.7k|    if (conf == NULL || section == NULL)
  ------------------
  |  Branch (27:9): [True: 0, False: 13.7k]
  |  Branch (27:25): [True: 0, False: 13.7k]
  ------------------
   28|      0|        return NULL;
   29|  13.7k|    vv.name = NULL;
   30|  13.7k|    vv.section = (char *)section;
   31|  13.7k|    return conf->data != NULL ? lh_CONF_VALUE_retrieve(conf->data, &vv) : NULL;
  ------------------
  |  |   73|  13.7k|#define lh_CONF_VALUE_retrieve(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_retrieve(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
  ------------------
  |  Branch (31:12): [True: 13.7k, False: 0]
  ------------------
   32|  13.7k|}
_CONF_add_string:
   46|  27.3k|{
   47|  27.3k|    CONF_VALUE *v = NULL;
   48|  27.3k|    STACK_OF(CONF_VALUE) *ts;
  ------------------
  |  |   31|  27.3k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   49|       |
   50|  27.3k|    ts = (STACK_OF(CONF_VALUE) *)section->value;
   51|       |
   52|  27.3k|    value->section = section->section;
   53|  27.3k|    if (!sk_CONF_VALUE_push(ts, value))
  ------------------
  |  |   52|  27.3k|#define sk_CONF_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
  ------------------
  |  Branch (53:9): [True: 0, False: 27.3k]
  ------------------
   54|      0|        return 0;
   55|       |
   56|  27.3k|    v = lh_CONF_VALUE_insert(conf->data, value);
  ------------------
  |  |   71|  27.3k|#define lh_CONF_VALUE_insert(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_insert(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_plain_type(ptr)))
  ------------------
   57|  27.3k|    if (v != NULL) {
  ------------------
  |  Branch (57:9): [True: 7.25k, False: 20.0k]
  ------------------
   58|  7.25k|        (void)sk_CONF_VALUE_delete_ptr(ts, v);
  ------------------
  |  |   51|  7.25k|#define sk_CONF_VALUE_delete_ptr(sk, ptr) ((CONF_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)))
  ------------------
   59|  7.25k|        OPENSSL_free(v->name);
  ------------------
  |  |  106|  7.25k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  7.25k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  7.25k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   60|  7.25k|        OPENSSL_free(v->value);
  ------------------
  |  |  106|  7.25k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  7.25k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  7.25k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|  7.25k|        OPENSSL_free(v);
  ------------------
  |  |  106|  7.25k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  7.25k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  7.25k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   62|  7.25k|    }
   63|  27.3k|    return 1;
   64|  27.3k|}
_CONF_get_string:
   68|  9.87k|{
   69|  9.87k|    CONF_VALUE *v, vv;
   70|  9.87k|    char *p;
   71|       |
   72|  9.87k|    if (name == NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 9.87k]
  ------------------
   73|      0|        return NULL;
   74|  9.87k|    if (conf == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 9.87k]
  ------------------
   75|      0|        return ossl_safe_getenv(name);
   76|  9.87k|    if (conf->data == NULL)
  ------------------
  |  Branch (76:9): [True: 0, False: 9.87k]
  ------------------
   77|      0|        return NULL;
   78|  9.87k|    if (section != NULL) {
  ------------------
  |  Branch (78:9): [True: 9.87k, False: 0]
  ------------------
   79|  9.87k|        vv.name = (char *)name;
   80|  9.87k|        vv.section = (char *)section;
   81|  9.87k|        v = lh_CONF_VALUE_retrieve(conf->data, &vv);
  ------------------
  |  |   73|  9.87k|#define lh_CONF_VALUE_retrieve(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_retrieve(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
  ------------------
   82|  9.87k|        if (v != NULL)
  ------------------
  |  Branch (82:13): [True: 6.19k, False: 3.67k]
  ------------------
   83|  6.19k|            return v->value;
   84|  3.67k|        if (strcmp(section, "ENV") == 0) {
  ------------------
  |  Branch (84:13): [True: 896, False: 2.78k]
  ------------------
   85|    896|            p = ossl_safe_getenv(name);
   86|    896|            if (p != NULL)
  ------------------
  |  Branch (86:17): [True: 573, False: 323]
  ------------------
   87|    573|                return p;
   88|    896|        }
   89|  3.67k|    }
   90|  3.10k|    vv.section = "default";
   91|  3.10k|    vv.name = (char *)name;
   92|  3.10k|    v = lh_CONF_VALUE_retrieve(conf->data, &vv);
  ------------------
  |  |   73|  3.10k|#define lh_CONF_VALUE_retrieve(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_retrieve(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
  ------------------
   93|  3.10k|    if (v == NULL)
  ------------------
  |  Branch (93:9): [True: 172, False: 2.93k]
  ------------------
   94|    172|        return NULL;
   95|  2.93k|    return v->value;
   96|  3.10k|}
_CONF_new_data:
  121|  3.13k|{
  122|  3.13k|    if (conf == NULL)
  ------------------
  |  Branch (122:9): [True: 0, False: 3.13k]
  ------------------
  123|      0|        return 0;
  124|  3.13k|    if (conf->data == NULL) {
  ------------------
  |  Branch (124:9): [True: 3.13k, False: 0]
  ------------------
  125|  3.13k|        conf->data = lh_CONF_VALUE_new(conf_value_hash, conf_value_cmp);
  ------------------
  |  |   68|  3.13k|#define lh_CONF_VALUE_new(hfn, cmp) ((LHASH_OF(CONF_VALUE) *)OPENSSL_LH_new(ossl_check_CONF_VALUE_lh_hashfunc_type(hfn), ossl_check_CONF_VALUE_lh_compfunc_type(cmp)))
  ------------------
  126|  3.13k|        if (conf->data == NULL)
  ------------------
  |  Branch (126:13): [True: 0, False: 3.13k]
  ------------------
  127|      0|            return 0;
  128|  3.13k|    }
  129|  3.13k|    return 1;
  130|  3.13k|}
_CONF_free_data:
  137|  4.27k|{
  138|  4.27k|    if (conf == NULL)
  ------------------
  |  Branch (138:9): [True: 0, False: 4.27k]
  ------------------
  139|      0|        return;
  140|       |
  141|  4.27k|    OPENSSL_free(conf->includedir);
  ------------------
  |  |  106|  4.27k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  4.27k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  4.27k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  142|  4.27k|    if (conf->data == NULL)
  ------------------
  |  Branch (142:9): [True: 1.14k, False: 3.13k]
  ------------------
  143|  1.14k|        return;
  144|       |
  145|       |    /* evil thing to make sure the 'OPENSSL_free()' works as expected */
  146|  3.13k|    lh_CONF_VALUE_set_down_load(conf->data, 0);
  ------------------
  |  |   80|  3.13k|#define lh_CONF_VALUE_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_CONF_VALUE_lh_type(lh), dl)
  ------------------
  147|  3.13k|    lh_CONF_VALUE_doall_LH_CONF_VALUE(conf->data, value_free_hash, conf->data);
  148|       |
  149|       |    /*
  150|       |     * We now have only 'section' entries in the hash table. Due to problems
  151|       |     * with
  152|       |     */
  153|       |
  154|  3.13k|    lh_CONF_VALUE_doall(conf->data, value_free_stack_doall);
  ------------------
  |  |   81|  3.13k|#define lh_CONF_VALUE_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_doallfunc_type(dfn))
  ------------------
  155|  3.13k|    lh_CONF_VALUE_free(conf->data);
  ------------------
  |  |   69|  3.13k|#define lh_CONF_VALUE_free(lh) OPENSSL_LH_free(ossl_check_CONF_VALUE_lh_type(lh))
  ------------------
  156|  3.13k|}
_CONF_new_section:
  186|  14.0k|{
  187|  14.0k|    STACK_OF(CONF_VALUE) *sk = NULL;
  ------------------
  |  |   31|  14.0k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  188|  14.0k|    int i;
  189|  14.0k|    CONF_VALUE *v = NULL, *vv;
  190|       |
  191|  14.0k|    if ((sk = sk_CONF_VALUE_new_null()) == NULL)
  ------------------
  |  |   45|  14.0k|#define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (191:9): [True: 0, False: 14.0k]
  ------------------
  192|      0|        goto err;
  193|  14.0k|    if ((v = OPENSSL_malloc(sizeof(*v))) == NULL)
  ------------------
  |  |   96|  14.0k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  14.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  14.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (193:9): [True: 0, False: 14.0k]
  ------------------
  194|      0|        goto err;
  195|  14.0k|    i = strlen(section) + 1;
  196|  14.0k|    if ((v->section = OPENSSL_malloc(i)) == NULL)
  ------------------
  |  |   96|  14.0k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  14.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  14.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (196:9): [True: 0, False: 14.0k]
  ------------------
  197|      0|        goto err;
  198|       |
  199|  14.0k|    memcpy(v->section, section, i);
  200|  14.0k|    v->name = NULL;
  201|  14.0k|    v->value = (char *)sk;
  202|       |
  203|  14.0k|    vv = lh_CONF_VALUE_insert(conf->data, v);
  ------------------
  |  |   71|  14.0k|#define lh_CONF_VALUE_insert(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_insert(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_plain_type(ptr)))
  ------------------
  204|  14.0k|    if (vv != NULL || lh_CONF_VALUE_error(conf->data) > 0)
  ------------------
  |  |   74|  14.0k|#define lh_CONF_VALUE_error(lh) OPENSSL_LH_error(ossl_check_CONF_VALUE_lh_type(lh))
  ------------------
  |  Branch (204:9): [True: 0, False: 14.0k]
  |  Branch (204:23): [True: 0, False: 14.0k]
  ------------------
  205|      0|        goto err;
  206|  14.0k|    return v;
  207|       |
  208|      0| err:
  209|      0|    sk_CONF_VALUE_free(sk);
  ------------------
  |  |   48|      0|#define sk_CONF_VALUE_free(sk) OPENSSL_sk_free(ossl_check_CONF_VALUE_sk_type(sk))
  ------------------
  210|      0|    if (v != NULL)
  ------------------
  |  Branch (210:9): [True: 0, False: 0]
  ------------------
  211|      0|        OPENSSL_free(v->section);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  212|      0|    OPENSSL_free(v);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  213|      0|    return NULL;
  214|  14.0k|}
conf_api.c:conf_value_hash:
   99|  88.1k|{
  100|  88.1k|    return (OPENSSL_LH_strhash(v->section) << 2) ^ OPENSSL_LH_strhash(v->name);
  101|  88.1k|}
conf_api.c:conf_value_cmp:
  104|  73.9k|{
  105|  73.9k|    int i;
  106|       |
  107|  73.9k|    if (a->section != b->section) {
  ------------------
  |  Branch (107:9): [True: 23.4k, False: 50.4k]
  ------------------
  108|  23.4k|        i = strcmp(a->section, b->section);
  109|  23.4k|        if (i != 0)
  ------------------
  |  Branch (109:13): [True: 1.29k, False: 22.1k]
  ------------------
  110|  1.29k|            return i;
  111|  23.4k|    }
  112|       |
  113|  72.6k|    if (a->name != NULL && b->name != NULL)
  ------------------
  |  Branch (113:9): [True: 37.8k, False: 34.7k]
  |  Branch (113:28): [True: 37.0k, False: 750]
  ------------------
  114|  37.0k|        return strcmp(a->name, b->name);
  115|  35.5k|    if (a->name == b->name)
  ------------------
  |  Branch (115:9): [True: 2.76k, False: 32.7k]
  ------------------
  116|  2.76k|        return 0;
  117|  32.7k|    return (a->name == NULL) ? -1 : 1;
  ------------------
  |  Branch (117:12): [True: 32.0k, False: 750]
  ------------------
  118|  35.5k|}
conf_api.c:value_free_hash:
  159|  34.1k|{
  160|  34.1k|    if (a->name != NULL)
  ------------------
  |  Branch (160:9): [True: 20.0k, False: 14.0k]
  ------------------
  161|  20.0k|        (void)lh_CONF_VALUE_delete(conf, a);
  ------------------
  |  |   72|  20.0k|#define lh_CONF_VALUE_delete(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_delete(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
  ------------------
  162|  34.1k|}
conf_api.c:value_free_stack_doall:
  165|  14.0k|{
  166|  14.0k|    CONF_VALUE *vv;
  167|  14.0k|    STACK_OF(CONF_VALUE) *sk;
  ------------------
  |  |   31|  14.0k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  168|  14.0k|    int i;
  169|       |
  170|  14.0k|    if (a->name != NULL)
  ------------------
  |  Branch (170:9): [True: 0, False: 14.0k]
  ------------------
  171|      0|        return;
  172|       |
  173|  14.0k|    sk = (STACK_OF(CONF_VALUE) *)a->value;
  174|  34.1k|    for (i = sk_CONF_VALUE_num(sk) - 1; i >= 0; i--) {
  ------------------
  |  |   42|  14.0k|#define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk))
  ------------------
  |  Branch (174:41): [True: 20.0k, False: 14.0k]
  ------------------
  175|  20.0k|        vv = sk_CONF_VALUE_value(sk, i);
  ------------------
  |  |   43|  20.0k|#define sk_CONF_VALUE_value(sk, idx) ((CONF_VALUE *)OPENSSL_sk_value(ossl_check_const_CONF_VALUE_sk_type(sk), (idx)))
  ------------------
  176|  20.0k|        OPENSSL_free(vv->value);
  ------------------
  |  |  106|  20.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  20.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  20.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|  20.0k|        OPENSSL_free(vv->name);
  ------------------
  |  |  106|  20.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  20.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  20.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  178|  20.0k|        OPENSSL_free(vv);
  ------------------
  |  |  106|  20.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  20.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  20.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  179|  20.0k|    }
  180|  14.0k|    sk_CONF_VALUE_free(sk);
  ------------------
  |  |   48|  14.0k|#define sk_CONF_VALUE_free(sk) OPENSSL_sk_free(ossl_check_CONF_VALUE_sk_type(sk))
  ------------------
  181|  14.0k|    OPENSSL_free(a->section);
  ------------------
  |  |  106|  14.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  14.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  14.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  182|  14.0k|    OPENSSL_free(a);
  ------------------
  |  |  106|  14.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  14.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  14.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  183|  14.0k|}

NCONF_default:
   87|  3.13k|{
   88|  3.13k|    return &default_method;
   89|  3.13k|}
conf_def.c:def_create:
  112|  3.13k|{
  113|  3.13k|    CONF *ret;
  114|       |
  115|  3.13k|    ret = OPENSSL_malloc(sizeof(*ret));
  ------------------
  |  |   96|  3.13k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  116|  3.13k|    if (ret != NULL)
  ------------------
  |  Branch (116:9): [True: 3.13k, False: 0]
  ------------------
  117|  3.13k|        if (meth->init(ret) == 0) {
  ------------------
  |  Branch (117:13): [True: 0, False: 3.13k]
  ------------------
  118|      0|            OPENSSL_free(ret);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  119|      0|            ret = NULL;
  120|      0|        }
  121|  3.13k|    return ret;
  122|  3.13k|}
conf_def.c:def_init_default:
  125|  4.27k|{
  126|  4.27k|    if (conf == NULL)
  ------------------
  |  Branch (126:9): [True: 0, False: 4.27k]
  ------------------
  127|      0|        return 0;
  128|       |
  129|  4.27k|    memset(conf, 0, sizeof(*conf));
  130|  4.27k|    conf->meth = &default_method;
  131|  4.27k|    conf->meth_data = (void *)CONF_type_default;
  132|       |
  133|  4.27k|    return 1;
  134|  4.27k|}
conf_def.c:def_destroy:
  151|  3.13k|{
  152|  3.13k|    if (def_destroy_data(conf)) {
  ------------------
  |  Branch (152:9): [True: 3.13k, False: 0]
  ------------------
  153|  3.13k|        OPENSSL_free(conf);
  ------------------
  |  |  106|  3.13k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|  3.13k|        return 1;
  155|  3.13k|    }
  156|      0|    return 0;
  157|  3.13k|}
conf_def.c:def_destroy_data:
  160|  4.27k|{
  161|  4.27k|    if (conf == NULL)
  ------------------
  |  Branch (161:9): [True: 0, False: 4.27k]
  ------------------
  162|      0|        return 0;
  163|  4.27k|    _CONF_free_data(conf);
  164|  4.27k|    return 1;
  165|  4.27k|}
conf_def.c:def_load_bio:
  209|  3.13k|{
  210|       |/* The macro BUFSIZE conflicts with a system macro in VxWorks */
  211|  3.13k|#define CONFBUFSIZE     512
  212|  3.13k|    int bufnum = 0, i, ii;
  213|  3.13k|    BUF_MEM *buff = NULL;
  214|  3.13k|    char *s, *p, *end;
  215|  3.13k|    int again;
  216|  3.13k|    int first_call = 1;
  217|  3.13k|    long eline = 0;
  218|  3.13k|    char btmp[DECIMAL_SIZE(eline) + 1];
  219|  3.13k|    CONF_VALUE *v = NULL, *tv;
  220|  3.13k|    CONF_VALUE *sv = NULL;
  221|  3.13k|    char *section = NULL, *buf;
  222|  3.13k|    char *start, *psection, *pname;
  223|  3.13k|    void *h = (void *)(conf->data);
  224|  3.13k|    STACK_OF(BIO) *biosk = NULL;
  ------------------
  |  |   31|  3.13k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  225|  3.13k|#ifndef OPENSSL_NO_POSIX_IO
  226|  3.13k|    char *dirpath = NULL;
  227|  3.13k|    OPENSSL_DIR_CTX *dirctx = NULL;
  228|  3.13k|#endif
  229|  3.13k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  230|  3.13k|    int numincludes = 0;
  231|  3.13k|#endif
  232|       |
  233|  3.13k|    if ((buff = BUF_MEM_new()) == NULL) {
  ------------------
  |  Branch (233:9): [True: 0, False: 3.13k]
  ------------------
  234|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  235|      0|        goto err;
  236|      0|    }
  237|       |
  238|  3.13k|    section = OPENSSL_strdup("default");
  ------------------
  |  |  110|  3.13k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  239|  3.13k|    if (section == NULL) {
  ------------------
  |  Branch (239:9): [True: 0, False: 3.13k]
  ------------------
  240|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  241|      0|        goto err;
  242|      0|    }
  243|       |
  244|  3.13k|    if (_CONF_new_data(conf) == 0) {
  ------------------
  |  Branch (244:9): [True: 0, False: 3.13k]
  ------------------
  245|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  246|      0|        goto err;
  247|      0|    }
  248|       |
  249|  3.13k|    sv = _CONF_new_section(conf, section);
  250|  3.13k|    if (sv == NULL) {
  ------------------
  |  Branch (250:9): [True: 0, False: 3.13k]
  ------------------
  251|      0|        ERR_raise(ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  252|      0|        goto err;
  253|      0|    }
  254|       |
  255|  3.13k|    bufnum = 0;
  256|  3.13k|    again = 0;
  257|  6.80M|    for (;;) {
  258|  6.80M|        if (!BUF_MEM_grow(buff, bufnum + CONFBUFSIZE)) {
  ------------------
  |  |  211|  6.80M|#define CONFBUFSIZE     512
  ------------------
  |  Branch (258:13): [True: 0, False: 6.80M]
  ------------------
  259|      0|            ERR_raise(ERR_LIB_CONF, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  260|      0|            goto err;
  261|      0|        }
  262|  6.80M|        p = &(buff->data[bufnum]);
  263|  6.80M|        *p = '\0';
  264|  6.80M| read_retry:
  265|  6.80M|        if (in != NULL && BIO_gets(in, p, CONFBUFSIZE - 1) < 0)
  ------------------
  |  |  211|  6.80M|#define CONFBUFSIZE     512
  ------------------
  |  Branch (265:13): [True: 6.80M, False: 0]
  |  Branch (265:27): [True: 0, False: 6.80M]
  ------------------
  266|      0|            goto err;
  267|  6.80M|        p[CONFBUFSIZE - 1] = '\0';
  ------------------
  |  |  211|  6.80M|#define CONFBUFSIZE     512
  ------------------
  268|  6.80M|        ii = i = strlen(p);
  269|  6.80M|        if (first_call) {
  ------------------
  |  Branch (269:13): [True: 3.13k, False: 6.80M]
  ------------------
  270|       |            /* Other BOMs imply unsupported multibyte encoding,
  271|       |             * so don't strip them and let the error raise */
  272|  3.13k|            const unsigned char utf8_bom[3] = {0xEF, 0xBB, 0xBF};
  273|       |
  274|  3.13k|            if (i >= 3 && memcmp(p, utf8_bom, 3) == 0) {
  ------------------
  |  Branch (274:17): [True: 2.59k, False: 535]
  |  Branch (274:27): [True: 3, False: 2.59k]
  ------------------
  275|      3|                memmove(p, p + 3, i - 3);
  276|      3|                p[i - 3] = 0;
  277|      3|                i -= 3;
  278|      3|                ii -= 3;
  279|      3|            }
  280|  3.13k|            first_call = 0;
  281|  3.13k|        }
  282|  6.80M|        if (i == 0 && !again) {
  ------------------
  |  Branch (282:13): [True: 5.36k, False: 6.80M]
  |  Branch (282:23): [True: 2.17k, False: 3.18k]
  ------------------
  283|       |            /* the currently processed BIO is NULL or at EOF */
  284|  2.17k|            BIO *parent;
  285|       |
  286|  2.17k|#ifndef OPENSSL_NO_POSIX_IO
  287|       |            /* continue processing with the next file from directory */
  288|  2.17k|            if (dirctx != NULL) {
  ------------------
  |  Branch (288:17): [True: 197, False: 1.98k]
  ------------------
  289|    197|                BIO *next;
  290|       |
  291|    197|                if ((next = get_next_file(dirpath, &dirctx)) != NULL) {
  ------------------
  |  Branch (291:21): [True: 121, False: 76]
  ------------------
  292|    121|                    BIO_vfree(in);
  293|    121|                    in = next;
  294|    121|                    goto read_retry;
  295|    121|                } else {
  296|     76|                    OPENSSL_free(dirpath);
  ------------------
  |  |  106|     76|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|     76|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|     76|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  297|     76|                    dirpath = NULL;
  298|     76|                }
  299|    197|            }
  300|  2.05k|#endif
  301|       |            /* no more files in directory, continue with processing parent */
  302|  2.05k|            if ((parent = sk_BIO_pop(biosk)) == NULL) {
  ------------------
  |  |  317|  2.05k|#define sk_BIO_pop(sk) ((BIO *)OPENSSL_sk_pop(ossl_check_BIO_sk_type(sk)))
  ------------------
  |  Branch (302:17): [True: 1.98k, False: 76]
  ------------------
  303|       |                /* everything processed get out of the loop */
  304|  1.98k|                break;
  305|  1.98k|            } else {
  306|     76|                BIO_vfree(in);
  307|     76|                in = parent;
  308|     76|                goto read_retry;
  309|     76|            }
  310|  2.05k|        }
  311|  6.80M|        again = 0;
  312|  13.5M|        while (i > 0) {
  ------------------
  |  Branch (312:16): [True: 6.84M, False: 6.68M]
  ------------------
  313|  6.84M|            if ((p[i - 1] != '\r') && (p[i - 1] != '\n'))
  ------------------
  |  Branch (313:17): [True: 6.84M, False: 215]
  |  Branch (313:39): [True: 122k, False: 6.71M]
  ------------------
  314|   122k|                break;
  315|  6.71M|            else
  316|  6.71M|                i--;
  317|  6.84M|        }
  318|       |        /*
  319|       |         * we removed some trailing stuff so there is a new line on the end.
  320|       |         */
  321|  6.80M|        if (ii && i == ii)
  ------------------
  |  Branch (321:13): [True: 6.80M, False: 3.18k]
  |  Branch (321:19): [True: 81.1k, False: 6.71M]
  ------------------
  322|  81.1k|            again = 1;          /* long line */
  323|  6.72M|        else {
  324|  6.72M|            p[i] = '\0';
  325|  6.72M|            eline++;            /* another input line */
  326|  6.72M|        }
  327|       |
  328|       |        /* we now have a line with trailing \r\n removed */
  329|       |
  330|       |        /* i is the number of bytes */
  331|  6.80M|        bufnum += i;
  332|       |
  333|  6.80M|        v = NULL;
  334|       |        /* check for line continuation */
  335|  6.80M|        if (bufnum >= 1) {
  ------------------
  |  Branch (335:13): [True: 125k, False: 6.67M]
  ------------------
  336|       |            /*
  337|       |             * If we have bytes and the last char '\\' and second last char
  338|       |             * is not '\\'
  339|       |             */
  340|   125k|            p = &(buff->data[bufnum - 1]);
  341|   125k|            if (IS_ESC(conf, p[0]) && ((bufnum <= 1) || !IS_ESC(conf, p[-1]))) {
  ------------------
  |  |   33|   251k|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|   125k|#define CONF_ESC          32
  |  |  ------------------
  |  |  |  Branch (33:32): [True: 2.16k, False: 123k]
  |  |  ------------------
  ------------------
                          if (IS_ESC(conf, p[0]) && ((bufnum <= 1) || !IS_ESC(conf, p[-1]))) {
  ------------------
  |  |   33|  1.76k|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|  1.76k|#define CONF_ESC          32
  |  |  ------------------
  ------------------
  |  Branch (341:40): [True: 407, False: 1.76k]
  |  Branch (341:57): [True: 872, False: 889]
  ------------------
  342|  1.27k|                bufnum--;
  343|  1.27k|                again = 1;
  344|  1.27k|            }
  345|   125k|        }
  346|  6.80M|        if (again)
  ------------------
  |  Branch (346:13): [True: 82.0k, False: 6.72M]
  ------------------
  347|  82.0k|            continue;
  348|  6.72M|        bufnum = 0;
  349|  6.72M|        buf = buff->data;
  350|       |
  351|  6.72M|        clear_comments(conf, buf);
  352|  6.72M|        s = eat_ws(conf, buf);
  353|  6.72M|        if (IS_EOF(conf, *s))
  ------------------
  |  |   32|  6.72M|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   24|  6.72M|#define CONF_EOF          8
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 6.68M, False: 35.2k]
  |  |  ------------------
  ------------------
  354|  6.68M|            continue;           /* blank line */
  355|  35.2k|        if (*s == '[') {
  ------------------
  |  Branch (355:13): [True: 3.09k, False: 32.1k]
  ------------------
  356|  3.09k|            char *ss;
  357|       |
  358|  3.09k|            s++;
  359|  3.09k|            start = eat_ws(conf, s);
  360|  3.09k|            ss = start;
  361|  3.85k| again:
  362|  3.85k|            end = eat_alpha_numeric(conf, ss);
  363|  3.85k|            p = eat_ws(conf, end);
  364|  3.85k|            if (*p != ']') {
  ------------------
  |  Branch (364:17): [True: 872, False: 2.98k]
  ------------------
  365|    872|                if (*p != '\0' && ss != p) {
  ------------------
  |  Branch (365:21): [True: 802, False: 70]
  |  Branch (365:35): [True: 763, False: 39]
  ------------------
  366|    763|                    ss = p;
  367|    763|                    goto again;
  368|    763|                }
  369|    872|                ERR_raise(ERR_LIB_CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET);
  ------------------
  |  |  401|    109|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    109|    (ERR_new(),                                                 \
  |  |  |  |  404|    109|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|    109|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|    109|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|    109|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    109|     ERR_set_error)
  |  |  ------------------
  ------------------
  370|    109|                goto err;
  371|    872|            }
  372|  2.98k|            *end = '\0';
  373|  2.98k|            if (!str_copy(conf, NULL, &section, start))
  ------------------
  |  Branch (373:17): [True: 0, False: 2.98k]
  ------------------
  374|      0|                goto err;
  375|  2.98k|            if ((sv = _CONF_get_section(conf, section)) == NULL)
  ------------------
  |  Branch (375:17): [True: 2.51k, False: 470]
  ------------------
  376|  2.51k|                sv = _CONF_new_section(conf, section);
  377|  2.98k|            if (sv == NULL) {
  ------------------
  |  Branch (377:17): [True: 0, False: 2.98k]
  ------------------
  378|      0|                ERR_raise(ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  379|      0|                goto err;
  380|      0|            }
  381|  2.98k|            continue;
  382|  32.1k|        } else {
  383|  32.1k|            pname = s;
  384|  32.1k|            end = eat_alpha_numeric(conf, s);
  385|  32.1k|            if ((end[0] == ':') && (end[1] == ':')) {
  ------------------
  |  Branch (385:17): [True: 10.8k, False: 21.2k]
  |  Branch (385:36): [True: 10.7k, False: 100]
  ------------------
  386|  10.7k|                *end = '\0';
  387|  10.7k|                end += 2;
  388|  10.7k|                psection = pname;
  389|  10.7k|                pname = end;
  390|  10.7k|                end = eat_alpha_numeric(conf, end);
  391|  21.3k|            } else {
  392|  21.3k|                psection = section;
  393|  21.3k|            }
  394|  32.1k|            p = eat_ws(conf, end);
  395|  32.1k|            if (strncmp(pname, ".pragma", 7) == 0
  ------------------
  |  Branch (395:17): [True: 2.81k, False: 29.3k]
  ------------------
  396|  32.1k|                && (p != pname + 7 || *p == '=')) {
  ------------------
  |  Branch (396:21): [True: 1.15k, False: 1.66k]
  |  Branch (396:39): [True: 1.65k, False: 9]
  ------------------
  397|  2.81k|                char *pval;
  398|       |
  399|  2.81k|                if (*p == '=') {
  ------------------
  |  Branch (399:21): [True: 1.66k, False: 1.14k]
  ------------------
  400|  1.66k|                    p++;
  401|  1.66k|                    p = eat_ws(conf, p);
  402|  1.66k|                }
  403|  2.81k|                trim_ws(conf, p);
  404|       |
  405|       |                /* Pragma values take the form keyword:value */
  406|  2.81k|                pval = strchr(p, ':');
  407|  2.81k|                if (pval == NULL || pval == p || pval[1] == '\0') {
  ------------------
  |  Branch (407:21): [True: 25, False: 2.78k]
  |  Branch (407:37): [True: 1, False: 2.78k]
  |  Branch (407:50): [True: 1, False: 2.78k]
  ------------------
  408|     27|                    ERR_raise(ERR_LIB_CONF, CONF_R_INVALID_PRAGMA);
  ------------------
  |  |  401|     27|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     27|    (ERR_new(),                                                 \
  |  |  |  |  404|     27|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|     27|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|     27|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|     27|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     27|     ERR_set_error)
  |  |  ------------------
  ------------------
  409|     27|                    goto err;
  410|     27|                }
  411|       |
  412|  2.78k|                *pval++ = '\0';
  413|  2.78k|                trim_ws(conf, p);
  414|  2.78k|                pval = eat_ws(conf, pval);
  415|       |
  416|       |                /*
  417|       |                 * Known pragmas:
  418|       |                 *
  419|       |                 * dollarid     takes "on", "true or "off", "false"
  420|       |                 * abspath      takes "on", "true or "off", "false"
  421|       |                 * includedir   directory prefix
  422|       |                 */
  423|  2.78k|                if (strcmp(p, "dollarid") == 0) {
  ------------------
  |  Branch (423:21): [True: 664, False: 2.11k]
  ------------------
  424|    664|                    if (!parsebool(pval, &conf->flag_dollarid))
  ------------------
  |  Branch (424:25): [True: 5, False: 659]
  ------------------
  425|      5|                        goto err;
  426|  2.11k|                } else if (strcmp(p, "abspath") == 0) {
  ------------------
  |  Branch (426:28): [True: 661, False: 1.45k]
  ------------------
  427|    661|                    if (!parsebool(pval, &conf->flag_abspath))
  ------------------
  |  Branch (427:25): [True: 48, False: 613]
  ------------------
  428|     48|                        goto err;
  429|  1.45k|                } else if (strcmp(p, "includedir") == 0) {
  ------------------
  |  Branch (429:28): [True: 312, False: 1.14k]
  ------------------
  430|    312|                    OPENSSL_free(conf->includedir);
  ------------------
  |  |  106|    312|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|    312|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|    312|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  431|    312|                    if ((conf->includedir = OPENSSL_strdup(pval)) == NULL) {
  ------------------
  |  |  110|    312|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|    312|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|    312|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (431:25): [True: 0, False: 312]
  ------------------
  432|      0|                        ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  433|      0|                        goto err;
  434|      0|                    }
  435|    312|                }
  436|       |
  437|       |                /*
  438|       |                 * We *ignore* any unknown pragma.
  439|       |                 */
  440|  2.73k|                continue;
  441|  29.3k|            } else if (strncmp(pname, ".include", 8) == 0
  ------------------
  |  Branch (441:24): [True: 1.09k, False: 28.2k]
  ------------------
  442|  29.3k|                && (p != pname + 8 || *p == '=')) {
  ------------------
  |  Branch (442:21): [True: 768, False: 323]
  |  Branch (442:39): [True: 311, False: 12]
  ------------------
  443|  1.07k|                char *include = NULL;
  444|  1.07k|                BIO *next;
  445|  1.07k|                const char *include_dir = ossl_safe_getenv("OPENSSL_CONF_INCLUDE");
  446|  1.07k|                char *include_path = NULL;
  447|       |
  448|  1.07k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  449|       |                /*
  450|       |                 * The include processing below can cause the "conf" fuzzer to
  451|       |                 * timeout due to the fuzzer inserting large and complicated
  452|       |                 * includes - with a large amount of time spent in
  453|       |                 * OPENSSL_strlcat/OPENSSL_strcpy. This is not a security
  454|       |                 * concern because config files should never come from untrusted
  455|       |                 * sources. We just set an arbitrary limit on the allowed
  456|       |                 * number of includes when fuzzing to prevent this timeout.
  457|       |                 */
  458|  1.07k|                if (numincludes++ > 10)
  ------------------
  |  Branch (458:21): [True: 17, False: 1.06k]
  ------------------
  459|     17|                    goto err;
  460|  1.06k|#endif
  461|       |
  462|  1.06k|                if (include_dir == NULL)
  ------------------
  |  Branch (462:21): [True: 1.06k, False: 0]
  ------------------
  463|  1.06k|                    include_dir = conf->includedir;
  464|       |
  465|  1.06k|                if (*p == '=') {
  ------------------
  |  Branch (465:21): [True: 342, False: 720]
  ------------------
  466|    342|                    p++;
  467|    342|                    p = eat_ws(conf, p);
  468|    342|                }
  469|  1.06k|                trim_ws(conf, p);
  470|  1.06k|                if (!str_copy(conf, psection, &include, p))
  ------------------
  |  Branch (470:21): [True: 2, False: 1.06k]
  ------------------
  471|      2|                    goto err;
  472|       |
  473|  1.06k|                if (include_dir != NULL && !ossl_is_absolute_path(include)) {
  ------------------
  |  Branch (473:21): [True: 158, False: 902]
  |  Branch (473:44): [True: 137, False: 21]
  ------------------
  474|    137|                    size_t newlen = strlen(include_dir) + strlen(include) + 2;
  475|       |
  476|    137|                    include_path = OPENSSL_malloc(newlen);
  ------------------
  |  |   96|    137|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|    137|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|    137|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  477|    137|                    if (include_path == NULL) {
  ------------------
  |  Branch (477:25): [True: 0, False: 137]
  ------------------
  478|      0|                        ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  479|      0|                        OPENSSL_free(include);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  480|      0|                        goto err;
  481|      0|                    }
  482|       |
  483|    137|                    OPENSSL_strlcpy(include_path, include_dir, newlen);
  484|    137|                    if (!ossl_ends_with_dirsep(include_path))
  ------------------
  |  Branch (484:25): [True: 113, False: 24]
  ------------------
  485|    113|                        OPENSSL_strlcat(include_path, "/", newlen);
  486|    137|                    OPENSSL_strlcat(include_path, include, newlen);
  487|    137|                    OPENSSL_free(include);
  ------------------
  |  |  106|    137|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|    137|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|    137|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  488|    923|                } else {
  489|    923|                    include_path = include;
  490|    923|                }
  491|       |
  492|  1.06k|                if (conf->flag_abspath
  ------------------
  |  Branch (492:21): [True: 38, False: 1.02k]
  ------------------
  493|  1.06k|                        && !ossl_is_absolute_path(include_path)) {
  ------------------
  |  Branch (493:28): [True: 9, False: 29]
  ------------------
  494|      9|                    ERR_raise(ERR_LIB_CONF, CONF_R_RELATIVE_PATH);
  ------------------
  |  |  401|      9|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      9|    (ERR_new(),                                                 \
  |  |  |  |  404|      9|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      9|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      9|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      9|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      9|     ERR_set_error)
  |  |  ------------------
  ------------------
  495|      9|                    OPENSSL_free(include_path);
  ------------------
  |  |  106|      9|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  496|      9|                    goto err;
  497|      9|                }
  498|       |
  499|       |                /* get the BIO of the included file */
  500|  1.05k|#ifndef OPENSSL_NO_POSIX_IO
  501|  1.05k|                next = process_include(include_path, &dirctx, &dirpath);
  502|  1.05k|                if (include_path != dirpath) {
  ------------------
  |  Branch (502:21): [True: 930, False: 121]
  ------------------
  503|       |                    /* dirpath will contain include in case of a directory */
  504|    930|                    OPENSSL_free(include_path);
  ------------------
  |  |  106|    930|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|    930|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|    930|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  505|    930|                }
  506|       |#else
  507|       |                next = BIO_new_file(include_path, "r");
  508|       |                OPENSSL_free(include_path);
  509|       |#endif
  510|       |
  511|  1.05k|                if (next != NULL) {
  ------------------
  |  Branch (511:21): [True: 137, False: 914]
  ------------------
  512|       |                    /* push the currently processing BIO onto stack */
  513|    137|                    if (biosk == NULL) {
  ------------------
  |  Branch (513:25): [True: 79, False: 58]
  ------------------
  514|     79|                        if ((biosk = sk_BIO_new_null()) == NULL) {
  ------------------
  |  |  308|     79|#define sk_BIO_new_null() ((STACK_OF(BIO) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (514:29): [True: 0, False: 79]
  ------------------
  515|      0|                            ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  516|      0|                            BIO_free(next);
  517|      0|                            goto err;
  518|      0|                        }
  519|     79|                    }
  520|    137|                    if (!sk_BIO_push(biosk, in)) {
  ------------------
  |  |  315|    137|#define sk_BIO_push(sk, ptr) OPENSSL_sk_push(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
  ------------------
  |  Branch (520:25): [True: 0, False: 137]
  ------------------
  521|      0|                        ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  522|      0|                        BIO_free(next);
  523|      0|                        goto err;
  524|      0|                    }
  525|       |                    /* continue with reading from the included BIO */
  526|    137|                    in = next;
  527|    137|                }
  528|  1.05k|                continue;
  529|  28.2k|            } else if (*p != '=') {
  ------------------
  |  Branch (529:24): [True: 688, False: 27.5k]
  ------------------
  530|    688|                ERR_raise_data(ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN,
  ------------------
  |  |  403|    688|    (ERR_new(),                                                 \
  |  |  404|    688|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  267|    688|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  268|    688|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  288|    688|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|    688|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN,
  ------------------
  |  |   84|    688|# define ERR_LIB_CONF            14
  ------------------
                              ERR_raise_data(ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN,
  ------------------
  |  |   29|    688|# define CONF_R_MISSING_EQUAL_SIGN                        101
  ------------------
  531|    688|                               "HERE-->%s", p);
  532|    688|                goto err;
  533|    688|            }
  534|  27.5k|            *end = '\0';
  535|  27.5k|            p++;
  536|  27.5k|            start = eat_ws(conf, p);
  537|  27.5k|            trim_ws(conf, start);
  538|       |
  539|  27.5k|            if ((v = OPENSSL_malloc(sizeof(*v))) == NULL) {
  ------------------
  |  |   96|  27.5k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  27.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  27.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (539:17): [True: 0, False: 27.5k]
  ------------------
  540|      0|                ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  541|      0|                goto err;
  542|      0|            }
  543|  27.5k|            v->name = OPENSSL_strdup(pname);
  ------------------
  |  |  110|  27.5k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  27.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  27.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  544|  27.5k|            v->value = NULL;
  545|  27.5k|            if (v->name == NULL) {
  ------------------
  |  Branch (545:17): [True: 0, False: 27.5k]
  ------------------
  546|      0|                ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  547|      0|                goto err;
  548|      0|            }
  549|  27.5k|            if (!str_copy(conf, psection, &(v->value), start))
  ------------------
  |  Branch (549:17): [True: 243, False: 27.3k]
  ------------------
  550|    243|                goto err;
  551|       |
  552|  27.3k|            if (strcmp(psection, section) != 0) {
  ------------------
  |  Branch (552:17): [True: 10.7k, False: 16.6k]
  ------------------
  553|  10.7k|                if ((tv = _CONF_get_section(conf, psection))
  ------------------
  |  Branch (553:21): [True: 8.42k, False: 2.29k]
  ------------------
  554|  10.7k|                    == NULL)
  555|  8.42k|                    tv = _CONF_new_section(conf, psection);
  556|  10.7k|                if (tv == NULL) {
  ------------------
  |  Branch (556:21): [True: 0, False: 10.7k]
  ------------------
  557|      0|                    ERR_raise(ERR_LIB_CONF,
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  558|      0|                              CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
  559|      0|                    goto err;
  560|      0|                }
  561|  10.7k|            } else
  562|  16.6k|                tv = sv;
  563|  27.3k|            if (_CONF_add_string(conf, tv, v) == 0) {
  ------------------
  |  Branch (563:17): [True: 0, False: 27.3k]
  ------------------
  564|      0|                ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  565|      0|                goto err;
  566|      0|            }
  567|  27.3k|            v = NULL;
  568|  27.3k|        }
  569|  35.2k|    }
  570|  1.98k|    BUF_MEM_free(buff);
  571|  1.98k|    OPENSSL_free(section);
  ------------------
  |  |  106|  1.98k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  1.98k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  1.98k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  572|       |    /*
  573|       |     * No need to pop, since we only get here if the stack is empty.
  574|       |     * If this causes a BIO leak, THE ISSUE IS SOMEWHERE ELSE!
  575|       |     */
  576|  1.98k|    sk_BIO_free(biosk);
  ------------------
  |  |  311|  1.98k|#define sk_BIO_free(sk) OPENSSL_sk_free(ossl_check_BIO_sk_type(sk))
  ------------------
  577|  1.98k|    return 1;
  578|       |
  579|  1.14k| err:
  580|  1.14k|    BUF_MEM_free(buff);
  581|  1.14k|    OPENSSL_free(section);
  ------------------
  |  |  106|  1.14k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  1.14k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  1.14k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  582|       |    /*
  583|       |     * Since |in| is the first element of the stack and should NOT be freed
  584|       |     * here, we cannot use sk_BIO_pop_free().  Instead, we pop and free one
  585|       |     * BIO at a time, making sure that the last one popped isn't.
  586|       |     */
  587|  1.20k|    while (sk_BIO_num(biosk) > 0) {
  ------------------
  |  |  305|  1.20k|#define sk_BIO_num(sk) OPENSSL_sk_num(ossl_check_const_BIO_sk_type(sk))
  ------------------
  |  Branch (587:12): [True: 61, False: 1.14k]
  ------------------
  588|     61|        BIO *popped = sk_BIO_pop(biosk);
  ------------------
  |  |  317|     61|#define sk_BIO_pop(sk) ((BIO *)OPENSSL_sk_pop(ossl_check_BIO_sk_type(sk)))
  ------------------
  589|     61|        BIO_vfree(in);
  590|     61|        in = popped;
  591|     61|    }
  592|  1.14k|    sk_BIO_free(biosk);
  ------------------
  |  |  311|  1.14k|#define sk_BIO_free(sk) OPENSSL_sk_free(ossl_check_BIO_sk_type(sk))
  ------------------
  593|  1.14k|#ifndef OPENSSL_NO_POSIX_IO
  594|  1.14k|    OPENSSL_free(dirpath);
  ------------------
  |  |  106|  1.14k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  1.14k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  1.14k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  595|  1.14k|    if (dirctx != NULL)
  ------------------
  |  Branch (595:9): [True: 45, False: 1.10k]
  ------------------
  596|     45|        OPENSSL_DIR_end(&dirctx);
  597|  1.14k|#endif
  598|  1.14k|    if (line != NULL)
  ------------------
  |  Branch (598:9): [True: 1.14k, False: 0]
  ------------------
  599|  1.14k|        *line = eline;
  600|  1.14k|    BIO_snprintf(btmp, sizeof(btmp), "%ld", eline);
  601|  1.14k|    ERR_add_error_data(2, "line ", btmp);
  602|  1.14k|    if (h != conf->data) {
  ------------------
  |  Branch (602:9): [True: 1.14k, False: 0]
  ------------------
  603|  1.14k|        CONF_free(conf->data);
  604|  1.14k|        conf->data = NULL;
  605|  1.14k|    }
  606|  1.14k|    if (v != NULL) {
  ------------------
  |  Branch (606:9): [True: 243, False: 905]
  ------------------
  607|    243|        OPENSSL_free(v->name);
  ------------------
  |  |  106|    243|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|    243|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|    243|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  608|    243|        OPENSSL_free(v->value);
  ------------------
  |  |  106|    243|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|    243|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|    243|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  609|    243|        OPENSSL_free(v);
  ------------------
  |  |  106|    243|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|    243|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|    243|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  610|    243|    }
  611|  1.14k|    return 0;
  612|  3.13k|}
conf_def.c:get_next_file:
  848|    580|{
  849|    580|    const char *filename;
  850|    580|    size_t pathlen;
  851|       |
  852|    580|    pathlen = strlen(path);
  853|  30.7k|    while ((filename = OPENSSL_DIR_read(dirctx, path)) != NULL) {
  ------------------
  |  Branch (853:12): [True: 30.4k, False: 338]
  ------------------
  854|  30.4k|        size_t namelen;
  855|       |
  856|  30.4k|        namelen = strlen(filename);
  857|       |
  858|       |
  859|  30.4k|        if ((namelen > 5
  ------------------
  |  Branch (859:14): [True: 19.9k, False: 10.4k]
  ------------------
  860|  30.4k|             && OPENSSL_strcasecmp(filename + namelen - 5, ".conf") == 0)
  ------------------
  |  Branch (860:17): [True: 1.78k, False: 18.1k]
  ------------------
  861|  30.4k|             || (namelen > 4
  ------------------
  |  Branch (861:18): [True: 21.9k, False: 6.67k]
  ------------------
  862|  28.6k|                 && OPENSSL_strcasecmp(filename + namelen - 4, ".cnf") == 0)) {
  ------------------
  |  Branch (862:21): [True: 0, False: 21.9k]
  ------------------
  863|  1.78k|            size_t newlen;
  864|  1.78k|            char *newpath;
  865|  1.78k|            BIO *bio;
  866|       |
  867|  1.78k|            newlen = pathlen + namelen + 2;
  868|  1.78k|            newpath = OPENSSL_zalloc(newlen);
  ------------------
  |  |   98|  1.78k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  1.78k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  1.78k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  869|  1.78k|            if (newpath == NULL) {
  ------------------
  |  Branch (869:17): [True: 0, False: 1.78k]
  ------------------
  870|      0|                ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  871|      0|                break;
  872|      0|            }
  873|       |#ifdef OPENSSL_SYS_VMS
  874|       |            /*
  875|       |             * If the given path isn't clear VMS syntax,
  876|       |             * we treat it as on Unix.
  877|       |             */
  878|       |            if (path[pathlen - 1] == ']'
  879|       |                || path[pathlen - 1] == '>'
  880|       |                || path[pathlen - 1] == ':') {
  881|       |                /* Clear VMS directory syntax, just copy as is */
  882|       |                OPENSSL_strlcpy(newpath, path, newlen);
  883|       |            }
  884|       |#endif
  885|  1.78k|            if (newpath[0] == '\0') {
  ------------------
  |  Branch (885:17): [True: 1.78k, False: 0]
  ------------------
  886|  1.78k|                OPENSSL_strlcpy(newpath, path, newlen);
  887|  1.78k|                OPENSSL_strlcat(newpath, "/", newlen);
  888|  1.78k|            }
  889|  1.78k|            OPENSSL_strlcat(newpath, filename, newlen);
  890|       |
  891|  1.78k|            bio = BIO_new_file(newpath, "r");
  892|  1.78k|            OPENSSL_free(newpath);
  ------------------
  |  |  106|  1.78k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  1.78k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  1.78k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  893|       |            /* Errors when opening files are non-fatal. */
  894|  1.78k|            if (bio != NULL)
  ------------------
  |  Branch (894:17): [True: 242, False: 1.53k]
  ------------------
  895|    242|                return bio;
  896|  1.78k|        }
  897|  30.4k|    }
  898|    338|    OPENSSL_DIR_end(dirctx);
  899|    338|    *dirctx = NULL;
  900|    338|    return NULL;
  901|    580|}
conf_def.c:is_keytype:
  905|   300M|{
  906|   300M|    const unsigned short * keytypes = (const unsigned short *) conf->meth_data;
  907|   300M|    unsigned char key = (unsigned char)c;
  908|       |
  909|       |#ifdef CHARSET_EBCDIC
  910|       |# if CHAR_BIT > 8
  911|       |    if (key > 255) {
  912|       |        /* key is out of range for os_toascii table */
  913|       |        return 0;
  914|       |    }
  915|       |# endif
  916|       |    /* convert key from ebcdic to ascii */
  917|       |    key = os_toascii[key];
  918|       |#endif
  919|       |
  920|   300M|    if (key > 127) {
  ------------------
  |  Branch (920:9): [True: 6.72M, False: 293M]
  ------------------
  921|       |        /* key is not a seven bit ascii character */
  922|  6.72M|        return 0;
  923|  6.72M|    }
  924|       |
  925|   293M|    return (keytypes[key] & type) ? 1 : 0;
  ------------------
  |  Branch (925:12): [True: 25.0M, False: 268M]
  ------------------
  926|   300M|}
conf_def.c:clear_comments:
  615|  6.72M|{
  616|  6.72M|    for (;;) {
  617|  6.72M|        if (IS_FCOMMENT(conf, *p)) {
  ------------------
  |  |   31|  6.72M|#define IS_FCOMMENT(conf,c)    is_keytype(conf, c, CONF_FCOMMENT)
  |  |  ------------------
  |  |  |  |   22|  6.72M|#define CONF_FCOMMENT     2048
  |  |  ------------------
  |  |  |  Branch (31:32): [True: 0, False: 6.72M]
  |  |  ------------------
  ------------------
  618|      0|            *p = '\0';
  619|      0|            return;
  620|      0|        }
  621|  6.72M|        if (!IS_WS(conf, *p)) {
  ------------------
  |  |   35|  6.72M|#define IS_WS(conf,c)          is_keytype(conf, c, CONF_WS)
  |  |  ------------------
  |  |  |  |   17|  6.72M|#define CONF_WS           16
  |  |  ------------------
  ------------------
  |  Branch (621:13): [True: 6.72M, False: 537]
  ------------------
  622|  6.72M|            break;
  623|  6.72M|        }
  624|    537|        p++;
  625|    537|    }
  626|       |
  627|  27.4M|    for (;;) {
  628|  27.4M|        if (IS_COMMENT(conf, *p)) {
  ------------------
  |  |   30|  27.4M|#define IS_COMMENT(conf,c)     is_keytype(conf, c, CONF_COMMENT)
  |  |  ------------------
  |  |  |  |   21|  27.4M|#define CONF_COMMENT      128
  |  |  ------------------
  |  |  |  Branch (30:32): [True: 8.62k, False: 27.4M]
  |  |  ------------------
  ------------------
  629|  8.62k|            *p = '\0';
  630|  8.62k|            return;
  631|  8.62k|        }
  632|  27.4M|        if (IS_DQUOTE(conf, *p)) {
  ------------------
  |  |   39|  27.4M|#define IS_DQUOTE(conf,c)      is_keytype(conf, c, CONF_DQUOTE)
  |  |  ------------------
  |  |  |  |   20|  27.4M|#define CONF_DQUOTE       1024
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 0, False: 27.4M]
  |  |  ------------------
  ------------------
  633|      0|            p = scan_dquote(conf, p);
  634|      0|            continue;
  635|      0|        }
  636|  27.4M|        if (IS_QUOTE(conf, *p)) {
  ------------------
  |  |   38|  27.4M|#define IS_QUOTE(conf,c)       is_keytype(conf, c, CONF_QUOTE)
  |  |  ------------------
  |  |  |  |   19|  27.4M|#define CONF_QUOTE        64
  |  |  ------------------
  |  |  |  Branch (38:32): [True: 13.8k, False: 27.4M]
  |  |  ------------------
  ------------------
  637|  13.8k|            p = scan_quote(conf, p);
  638|  13.8k|            continue;
  639|  13.8k|        }
  640|  27.4M|        if (IS_ESC(conf, *p)) {
  ------------------
  |  |   33|  27.4M|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|  27.4M|#define CONF_ESC          32
  |  |  ------------------
  |  |  |  Branch (33:32): [True: 33.8k, False: 27.3M]
  |  |  ------------------
  ------------------
  641|  33.8k|            p = scan_esc(conf, p);
  ------------------
  |  |   53|  33.8k|#define scan_esc(conf,p)        (((IS_EOF((conf),(p)[1]))?((p)+1):((p)+2)))
  |  |  ------------------
  |  |  |  |   32|  33.8k|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  |  |  ------------------
  |  |  |  |  |  |   24|  33.8k|#define CONF_EOF          8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (53:35): [True: 360, False: 33.5k]
  |  |  ------------------
  ------------------
  642|  33.8k|            continue;
  643|  33.8k|        }
  644|  27.3M|        if (IS_EOF(conf, *p))
  ------------------
  |  |   32|  27.3M|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   24|  27.3M|#define CONF_EOF          8
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 6.71M, False: 20.6M]
  |  |  ------------------
  ------------------
  645|  6.71M|            return;
  646|  20.6M|        else
  647|  20.6M|            p++;
  648|  27.3M|    }
  649|  6.72M|}
conf_def.c:scan_quote:
  963|  13.8k|{
  964|  13.8k|    int q = *p;
  965|       |
  966|  13.8k|    p++;
  967|  17.9M|    while (!(IS_EOF(conf, *p)) && (*p != q)) {
  ------------------
  |  |   32|  17.9M|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   24|  17.9M|#define CONF_EOF          8
  |  |  ------------------
  ------------------
  |  Branch (967:12): [True: 17.9M, False: 1.35k]
  |  Branch (967:35): [True: 17.9M, False: 12.3k]
  ------------------
  968|  17.9M|        if (IS_ESC(conf, *p)) {
  ------------------
  |  |   33|  17.9M|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|  17.9M|#define CONF_ESC          32
  |  |  ------------------
  |  |  |  Branch (33:32): [True: 22.4k, False: 17.9M]
  |  |  ------------------
  ------------------
  969|  22.4k|            p++;
  970|  22.4k|            if (IS_EOF(conf, *p))
  ------------------
  |  |   32|  22.4k|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   24|  22.4k|#define CONF_EOF          8
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 212, False: 22.2k]
  |  |  ------------------
  ------------------
  971|    212|                return p;
  972|  22.4k|        }
  973|  17.9M|        p++;
  974|  17.9M|    }
  975|  13.6k|    if (*p == q)
  ------------------
  |  Branch (975:9): [True: 12.3k, False: 1.35k]
  ------------------
  976|  12.3k|        p++;
  977|  13.6k|    return p;
  978|  13.8k|}
conf_def.c:eat_ws:
  929|  6.79M|{
  930|  6.79M|    while (IS_WS(conf, *p) && (!IS_EOF(conf, *p)))
  ------------------
  |  |   35|  13.5M|#define IS_WS(conf,c)          is_keytype(conf, c, CONF_WS)
  |  |  ------------------
  |  |  |  |   17|  6.79M|#define CONF_WS           16
  |  |  ------------------
  |  |  |  Branch (35:32): [True: 3.01k, False: 6.79M]
  |  |  ------------------
  ------------------
                  while (IS_WS(conf, *p) && (!IS_EOF(conf, *p)))
  ------------------
  |  |   32|  3.01k|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   24|  3.01k|#define CONF_EOF          8
  |  |  ------------------
  ------------------
  |  Branch (930:31): [True: 3.01k, False: 0]
  ------------------
  931|  3.01k|        p++;
  932|  6.79M|    return p;
  933|  6.79M|}
conf_def.c:eat_alpha_numeric:
  949|  46.8k|{
  950|  8.11M|    for (;;) {
  951|  8.11M|        if (IS_ESC(conf, *p)) {
  ------------------
  |  |   33|  8.11M|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|  8.11M|#define CONF_ESC          32
  |  |  ------------------
  |  |  |  Branch (33:32): [True: 11.1k, False: 8.10M]
  |  |  ------------------
  ------------------
  952|  11.1k|            p = scan_esc(conf, p);
  ------------------
  |  |   53|  11.1k|#define scan_esc(conf,p)        (((IS_EOF((conf),(p)[1]))?((p)+1):((p)+2)))
  |  |  ------------------
  |  |  |  |   32|  11.1k|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  |  |  ------------------
  |  |  |  |  |  |   24|  11.1k|#define CONF_EOF          8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (53:35): [True: 51, False: 11.1k]
  |  |  ------------------
  ------------------
  953|  11.1k|            continue;
  954|  11.1k|        }
  955|  8.10M|        if (!(IS_ALNUM_PUNCT(conf, *p)
  ------------------
  |  |   37|  16.2M|#define IS_ALNUM_PUNCT(conf,c) is_keytype(conf, c, CONF_ALNUM_PUNCT)
  |  |  ------------------
  |  |  |  |   27|  8.10M|#define CONF_ALNUM_PUNCT  (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  8.10M|#define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   13|  8.10M|#define CONF_UPPER        2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   14|  8.10M|#define CONF_LOWER        4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM_PUNCT  (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   12|  8.10M|#define CONF_NUMBER       1
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM_PUNCT  (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   15|  8.10M|#define CONF_UNDER        256
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM_PUNCT  (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  8.10M|#define CONF_PUNCT        512
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (37:32): [True: 8.05M, False: 47.5k]
  |  |  ------------------
  ------------------
  956|  8.10M|              || (conf->flag_dollarid && IS_DOLLAR(conf, *p))))
  ------------------
  |  |   40|  6.27k|#define IS_DOLLAR(conf,c)      is_keytype(conf, c, CONF_DOLLAR)
  |  |  ------------------
  |  |  |  |   23|  6.27k|#define CONF_DOLLAR       4096
  |  |  ------------------
  |  |  |  Branch (40:32): [True: 750, False: 5.52k]
  |  |  ------------------
  ------------------
  |  Branch (956:19): [True: 6.27k, False: 41.2k]
  ------------------
  957|  46.8k|            return p;
  958|  8.05M|        p++;
  959|  8.05M|    }
  960|  46.8k|}
conf_def.c:str_copy:
  652|  31.6k|{
  653|  31.6k|    int q, r, rr = 0, to = 0, len = 0;
  654|  31.6k|    char *s, *e, *rp, *p, *rrp, *np, *cp, v;
  655|  31.6k|    BUF_MEM *buf;
  656|       |
  657|  31.6k|    if ((buf = BUF_MEM_new()) == NULL)
  ------------------
  |  Branch (657:9): [True: 0, False: 31.6k]
  ------------------
  658|      0|        return 0;
  659|       |
  660|  31.6k|    len = strlen(from) + 1;
  661|  31.6k|    if (!BUF_MEM_grow(buf, len))
  ------------------
  |  Branch (661:9): [True: 0, False: 31.6k]
  ------------------
  662|      0|        goto err;
  663|       |
  664|  6.94M|    for (;;) {
  665|  6.94M|        if (IS_QUOTE(conf, *from)) {
  ------------------
  |  |   38|  6.94M|#define IS_QUOTE(conf,c)       is_keytype(conf, c, CONF_QUOTE)
  |  |  ------------------
  |  |  |  |   19|  6.94M|#define CONF_QUOTE        64
  |  |  ------------------
  |  |  |  Branch (38:32): [True: 13.0k, False: 6.93M]
  |  |  ------------------
  ------------------
  666|  13.0k|            q = *from;
  667|  13.0k|            from++;
  668|  13.4M|            while (!IS_EOF(conf, *from) && (*from != q)) {
  ------------------
  |  |   32|  26.9M|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   24|  13.4M|#define CONF_EOF          8
  |  |  ------------------
  ------------------
  |  Branch (668:20): [True: 13.4M, False: 1.05k]
  |  Branch (668:44): [True: 13.4M, False: 11.5k]
  ------------------
  669|  13.4M|                if (IS_ESC(conf, *from)) {
  ------------------
  |  |   33|  13.4M|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|  13.4M|#define CONF_ESC          32
  |  |  ------------------
  |  |  |  Branch (33:32): [True: 16.5k, False: 13.4M]
  |  |  ------------------
  ------------------
  670|  16.5k|                    from++;
  671|  16.5k|                    if (IS_EOF(conf, *from))
  ------------------
  |  |   32|  16.5k|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   24|  16.5k|#define CONF_EOF          8
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 395, False: 16.1k]
  |  |  ------------------
  ------------------
  672|    395|                        break;
  673|  16.5k|                }
  674|  13.4M|                buf->data[to++] = *(from++);
  675|  13.4M|            }
  676|  13.0k|            if (*from == q)
  ------------------
  |  Branch (676:17): [True: 11.5k, False: 1.45k]
  ------------------
  677|  11.5k|                from++;
  678|  6.93M|        } else if (IS_DQUOTE(conf, *from)) {
  ------------------
  |  |   39|  6.93M|#define IS_DQUOTE(conf,c)      is_keytype(conf, c, CONF_DQUOTE)
  |  |  ------------------
  |  |  |  |   20|  6.93M|#define CONF_DQUOTE       1024
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 0, False: 6.93M]
  |  |  ------------------
  ------------------
  679|      0|            q = *from;
  680|      0|            from++;
  681|      0|            while (!IS_EOF(conf, *from)) {
  ------------------
  |  |   32|      0|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   24|      0|#define CONF_EOF          8
  |  |  ------------------
  ------------------
  |  Branch (681:20): [True: 0, False: 0]
  ------------------
  682|      0|                if (*from == q) {
  ------------------
  |  Branch (682:21): [True: 0, False: 0]
  ------------------
  683|      0|                    if (*(from + 1) == q) {
  ------------------
  |  Branch (683:25): [True: 0, False: 0]
  ------------------
  684|      0|                        from++;
  685|      0|                    } else {
  686|      0|                        break;
  687|      0|                    }
  688|      0|                }
  689|      0|                buf->data[to++] = *(from++);
  690|      0|            }
  691|      0|            if (*from == q)
  ------------------
  |  Branch (691:17): [True: 0, False: 0]
  ------------------
  692|      0|                from++;
  693|  6.93M|        } else if (IS_ESC(conf, *from)) {
  ------------------
  |  |   33|  6.93M|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|  6.93M|#define CONF_ESC          32
  |  |  ------------------
  |  |  |  Branch (33:32): [True: 19.9k, False: 6.91M]
  |  |  ------------------
  ------------------
  694|  19.9k|            from++;
  695|  19.9k|            v = *(from++);
  696|  19.9k|            if (IS_EOF(conf, v))
  ------------------
  |  |   32|  19.9k|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   24|  19.9k|#define CONF_EOF          8
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 507, False: 19.4k]
  |  |  ------------------
  ------------------
  697|    507|                break;
  698|  19.4k|            else if (v == 'r')
  ------------------
  |  Branch (698:22): [True: 751, False: 18.6k]
  ------------------
  699|    751|                v = '\r';
  700|  18.6k|            else if (v == 'n')
  ------------------
  |  Branch (700:22): [True: 319, False: 18.3k]
  ------------------
  701|    319|                v = '\n';
  702|  18.3k|            else if (v == 'b')
  ------------------
  |  Branch (702:22): [True: 327, False: 18.0k]
  ------------------
  703|    327|                v = '\b';
  704|  18.0k|            else if (v == 't')
  ------------------
  |  Branch (704:22): [True: 200, False: 17.8k]
  ------------------
  705|    200|                v = '\t';
  706|  19.4k|            buf->data[to++] = v;
  707|  6.91M|        } else if (IS_EOF(conf, *from))
  ------------------
  |  |   32|  6.91M|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   24|  6.91M|#define CONF_EOF          8
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 30.8k, False: 6.88M]
  |  |  ------------------
  ------------------
  708|  30.8k|            break;
  709|  6.88M|        else if (*from == '$'
  ------------------
  |  Branch (709:18): [True: 26.1k, False: 6.85M]
  ------------------
  710|  6.88M|                 && (!conf->flag_dollarid
  ------------------
  |  Branch (710:22): [True: 9.53k, False: 16.5k]
  ------------------
  711|  26.1k|                     || from[1] == '{'
  ------------------
  |  Branch (711:25): [True: 199, False: 16.3k]
  ------------------
  712|  26.1k|                     || from[1] == '(')) {
  ------------------
  |  Branch (712:25): [True: 206, False: 16.1k]
  ------------------
  713|  9.93k|            size_t newsize;
  714|       |
  715|       |            /* try to expand it */
  716|  9.93k|            rrp = NULL;
  717|  9.93k|            s = &(from[1]);
  718|  9.93k|            if (*s == '{')
  ------------------
  |  Branch (718:17): [True: 401, False: 9.53k]
  ------------------
  719|    401|                q = '}';
  720|  9.53k|            else if (*s == '(')
  ------------------
  |  Branch (720:22): [True: 479, False: 9.05k]
  ------------------
  721|    479|                q = ')';
  722|  9.05k|            else
  723|  9.05k|                q = 0;
  724|       |
  725|  9.93k|            if (q)
  ------------------
  |  Branch (725:17): [True: 880, False: 9.05k]
  ------------------
  726|    880|                s++;
  727|  9.93k|            cp = section;
  728|  9.93k|            e = np = s;
  729|  3.36M|            while (IS_ALNUM(conf, *e)
  ------------------
  |  |   36|  6.72M|#define IS_ALNUM(conf,c)       is_keytype(conf, c, CONF_ALNUM)
  |  |  ------------------
  |  |  |  |   26|  3.36M|#define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  3.36M|#define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   13|  3.36M|#define CONF_UPPER        2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   14|  3.36M|#define CONF_LOWER        4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
  |  |  |  |  ------------------
  |  |  |  |  |  |   12|  3.36M|#define CONF_NUMBER       1
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
  |  |  |  |  ------------------
  |  |  |  |  |  |   15|  3.36M|#define CONF_UNDER        256
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (36:32): [True: 3.35M, False: 10.1k]
  |  |  ------------------
  ------------------
  730|  3.36M|                   || (conf->flag_dollarid && IS_DOLLAR(conf, *e)))
  ------------------
  |  |   40|    591|#define IS_DOLLAR(conf,c)      is_keytype(conf, c, CONF_DOLLAR)
  |  |  ------------------
  |  |  |  |   23|    591|#define CONF_DOLLAR       4096
  |  |  ------------------
  |  |  |  Branch (40:32): [True: 186, False: 405]
  |  |  ------------------
  ------------------
  |  Branch (730:24): [True: 591, False: 9.53k]
  ------------------
  731|  3.35M|                e++;
  732|  9.93k|            if ((e[0] == ':') && (e[1] == ':')) {
  ------------------
  |  Branch (732:17): [True: 1.49k, False: 8.44k]
  |  Branch (732:34): [True: 1.26k, False: 226]
  ------------------
  733|  1.26k|                cp = np;
  734|  1.26k|                rrp = e;
  735|  1.26k|                rr = *e;
  736|  1.26k|                *rrp = '\0';
  737|  1.26k|                e += 2;
  738|  1.26k|                np = e;
  739|  1.85k|                while (IS_ALNUM(conf, *e)
  ------------------
  |  |   36|  3.70k|#define IS_ALNUM(conf,c)       is_keytype(conf, c, CONF_ALNUM)
  |  |  ------------------
  |  |  |  |   26|  1.85k|#define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|  1.85k|#define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   13|  1.85k|#define CONF_UPPER        2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   14|  1.85k|#define CONF_LOWER        4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
  |  |  |  |  ------------------
  |  |  |  |  |  |   12|  1.85k|#define CONF_NUMBER       1
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
  |  |  |  |  ------------------
  |  |  |  |  |  |   15|  1.85k|#define CONF_UNDER        256
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (36:32): [True: 401, False: 1.45k]
  |  |  ------------------
  ------------------
  740|  1.85k|                       || (conf->flag_dollarid && IS_DOLLAR(conf, *e)))
  ------------------
  |  |   40|    195|#define IS_DOLLAR(conf,c)      is_keytype(conf, c, CONF_DOLLAR)
  |  |  ------------------
  |  |  |  |   23|    195|#define CONF_DOLLAR       4096
  |  |  ------------------
  |  |  |  Branch (40:32): [True: 186, False: 9]
  |  |  ------------------
  ------------------
  |  Branch (740:28): [True: 195, False: 1.25k]
  ------------------
  741|    587|                    e++;
  742|  1.26k|            }
  743|  9.93k|            r = *e;
  744|  9.93k|            *e = '\0';
  745|  9.93k|            rp = e;
  746|  9.93k|            if (q) {
  ------------------
  |  Branch (746:17): [True: 880, False: 9.05k]
  ------------------
  747|    880|                if (r != q) {
  ------------------
  |  Branch (747:21): [True: 67, False: 813]
  ------------------
  748|     67|                    ERR_raise(ERR_LIB_CONF, CONF_R_NO_CLOSE_BRACE);
  ------------------
  |  |  401|     67|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     67|    (ERR_new(),                                                 \
  |  |  |  |  404|     67|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|     67|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|     67|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|     67|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     67|     ERR_set_error)
  |  |  ------------------
  ------------------
  749|     67|                    goto err;
  750|     67|                }
  751|    813|                e++;
  752|    813|            }
  753|       |            /*-
  754|       |             * So at this point we have
  755|       |             * np which is the start of the name string which is
  756|       |             *   '\0' terminated.
  757|       |             * cp which is the start of the section string which is
  758|       |             *   '\0' terminated.
  759|       |             * e is the 'next point after'.
  760|       |             * r and rr are the chars replaced by the '\0'
  761|       |             * rp and rrp is where 'r' and 'rr' came from.
  762|       |             */
  763|  9.87k|            p = _CONF_get_string(conf, cp, np);
  764|  9.87k|            if (rrp != NULL)
  ------------------
  |  Branch (764:17): [True: 1.25k, False: 8.61k]
  ------------------
  765|  1.25k|                *rrp = rr;
  766|  9.87k|            *rp = r;
  767|  9.87k|            if (p == NULL) {
  ------------------
  |  Branch (767:17): [True: 172, False: 9.70k]
  ------------------
  768|    172|                ERR_raise(ERR_LIB_CONF, CONF_R_VARIABLE_HAS_NO_VALUE);
  ------------------
  |  |  401|    172|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    172|    (ERR_new(),                                                 \
  |  |  |  |  404|    172|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|    172|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|    172|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|    172|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    172|     ERR_set_error)
  |  |  ------------------
  ------------------
  769|    172|                goto err;
  770|    172|            }
  771|  9.70k|            newsize = strlen(p) + buf->length - (e - from);
  772|  9.70k|            if (newsize > MAX_CONF_VALUE_LENGTH) {
  ------------------
  |  |   43|  9.70k|#define MAX_CONF_VALUE_LENGTH       65536
  ------------------
  |  Branch (772:17): [True: 6, False: 9.69k]
  ------------------
  773|      6|                ERR_raise(ERR_LIB_CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG);
  ------------------
  |  |  401|      6|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      6|    (ERR_new(),                                                 \
  |  |  |  |  404|      6|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      6|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      6|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      6|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      6|     ERR_set_error)
  |  |  ------------------
  ------------------
  774|      6|                goto err;
  775|      6|            }
  776|  9.69k|            if (!BUF_MEM_grow_clean(buf, newsize)) {
  ------------------
  |  Branch (776:17): [True: 0, False: 9.69k]
  ------------------
  777|      0|                ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  778|      0|                goto err;
  779|      0|            }
  780|  4.57M|            while (*p)
  ------------------
  |  Branch (780:20): [True: 4.56M, False: 9.69k]
  ------------------
  781|  4.56M|                buf->data[to++] = *(p++);
  782|       |
  783|       |            /*
  784|       |             * Since we change the pointer 'from', we also have to change the
  785|       |             * perceived length of the string it points at.  /RL
  786|       |             */
  787|  9.69k|            len -= e - from;
  788|  9.69k|            from = e;
  789|       |
  790|       |            /*
  791|       |             * In case there were no braces or parenthesis around the
  792|       |             * variable reference, we have to put back the character that was
  793|       |             * replaced with a '\0'.  /RL
  794|       |             */
  795|  9.69k|            *rp = r;
  796|  9.69k|        } else
  797|  6.87M|            buf->data[to++] = *(from++);
  798|  6.94M|    }
  799|  31.3k|    buf->data[to] = '\0';
  800|  31.3k|    OPENSSL_free(*pto);
  ------------------
  |  |  106|  31.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  31.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  31.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  801|  31.3k|    *pto = buf->data;
  802|  31.3k|    OPENSSL_free(buf);
  ------------------
  |  |  106|  31.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  31.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  31.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  803|  31.3k|    return 1;
  804|    245| err:
  805|    245|    BUF_MEM_free(buf);
  806|    245|    return 0;
  807|  31.6k|}
conf_def.c:trim_ws:
  936|  34.2k|{
  937|  34.2k|    char *p = start;
  938|       |
  939|  25.8M|    while (!IS_EOF(conf, *p))
  ------------------
  |  |   32|  25.8M|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   24|  25.8M|#define CONF_EOF          8
  |  |  ------------------
  ------------------
  |  Branch (939:12): [True: 25.8M, False: 34.2k]
  ------------------
  940|  25.8M|        p++;
  941|  34.2k|    p--;
  942|  35.0k|    while ((p >= start) && IS_WS(conf, *p))
  ------------------
  |  |   35|  13.0k|#define IS_WS(conf,c)          is_keytype(conf, c, CONF_WS)
  |  |  ------------------
  |  |  |  |   17|  13.0k|#define CONF_WS           16
  |  |  ------------------
  |  |  |  Branch (35:32): [True: 817, False: 12.2k]
  |  |  ------------------
  ------------------
  |  Branch (942:12): [True: 13.0k, False: 21.9k]
  ------------------
  943|    817|        p--;
  944|  34.2k|    p++;
  945|  34.2k|    *p = '\0';
  946|  34.2k|}
conf_def.c:parsebool:
  194|  1.32k|{
  195|  1.32k|    if (OPENSSL_strcasecmp(pval, "on") == 0
  ------------------
  |  Branch (195:9): [True: 873, False: 452]
  ------------------
  196|  1.32k|            || OPENSSL_strcasecmp(pval, "true") == 0) {
  ------------------
  |  Branch (196:16): [True: 196, False: 256]
  ------------------
  197|  1.06k|        *flag = 1;
  198|  1.06k|    } else if (OPENSSL_strcasecmp(pval, "off") == 0
  ------------------
  |  Branch (198:16): [True: 203, False: 53]
  ------------------
  199|    256|            || OPENSSL_strcasecmp(pval, "false") == 0) {
  ------------------
  |  Branch (199:16): [True: 0, False: 53]
  ------------------
  200|    203|        *flag = 0;
  201|    203|    } else {
  202|     53|        ERR_raise(ERR_LIB_CONF, CONF_R_INVALID_PRAGMA);
  ------------------
  |  |  401|     53|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     53|    (ERR_new(),                                                 \
  |  |  |  |  404|     53|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|     53|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|     53|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|     53|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     53|     ERR_set_error)
  |  |  ------------------
  ------------------
  203|     53|        return 0;
  204|     53|    }
  205|  1.27k|    return 1;
  206|  1.32k|}
conf_def.c:process_include:
  817|  1.05k|{
  818|  1.05k|    struct stat st;
  819|  1.05k|    BIO *next;
  820|       |
  821|  1.05k|    if (stat(include, &st) < 0) {
  ------------------
  |  Branch (821:9): [True: 652, False: 399]
  ------------------
  822|    652|        ERR_raise_data(ERR_LIB_SYS, errno, "calling stat(%s)", include);
  ------------------
  |  |  403|    652|    (ERR_new(),                                                 \
  |  |  404|    652|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  267|    652|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  268|    652|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  288|    652|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|    652|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, errno, "calling stat(%s)", include);
  ------------------
  |  |   72|    652|# define ERR_LIB_SYS             2
  ------------------
  823|       |        /* missing include file is not fatal error */
  824|    652|        return NULL;
  825|    652|    }
  826|       |
  827|    399|    if (S_ISDIR(st.st_mode)) {
  828|    383|        if (*dirctx != NULL) {
  ------------------
  |  Branch (828:13): [True: 0, False: 383]
  ------------------
  829|      0|            ERR_raise_data(ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE,
  ------------------
  |  |   84|      0|# define ERR_LIB_CONF            14
  ------------------
                          ERR_raise_data(ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE,
  ------------------
  |  |   40|      0|# define CONF_R_RECURSIVE_DIRECTORY_INCLUDE               111
  ------------------
  830|      0|                           "%s", include);
  831|      0|            return NULL;
  832|      0|        }
  833|       |        /* a directory, load its contents */
  834|    383|        if ((next = get_next_file(include, dirctx)) != NULL)
  ------------------
  |  Branch (834:13): [True: 121, False: 262]
  ------------------
  835|    121|            *dirpath = include;
  836|    383|        return next;
  837|    383|    }
  838|       |
  839|     16|    next = BIO_new_file(include, "r");
  840|     16|    return next;
  841|    399|}

ossl_err_load_CONF_strings:
   66|      2|{
   67|      2|#ifndef OPENSSL_NO_ERR
   68|      2|    if (ERR_reason_error_string(CONF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (68:9): [True: 2, False: 0]
  ------------------
   69|      2|        ERR_load_strings_const(CONF_str_reasons);
   70|      2|#endif
   71|      2|    return 1;
   72|      2|}

CONF_set_nconf:
   27|  1.14k|{
   28|  1.14k|    if (default_CONF_method == NULL)
  ------------------
  |  Branch (28:9): [True: 1, False: 1.14k]
  ------------------
   29|      1|        default_CONF_method = NCONF_default();
   30|       |
   31|  1.14k|    default_CONF_method->init(conf);
   32|  1.14k|    conf->data = hash;
   33|  1.14k|}
CONF_free:
  144|  1.14k|{
  145|  1.14k|    CONF ctmp;
  146|  1.14k|    CONF_set_nconf(&ctmp, conf);
  147|  1.14k|    NCONF_free_data(&ctmp);
  148|  1.14k|}
NCONF_new_ex:
  183|  3.13k|{
  184|  3.13k|    CONF *ret;
  185|       |
  186|  3.13k|    if (meth == NULL)
  ------------------
  |  Branch (186:9): [True: 3.13k, False: 0]
  ------------------
  187|  3.13k|        meth = NCONF_default();
  188|       |
  189|  3.13k|    ret = meth->create(meth);
  190|  3.13k|    if (ret == NULL) {
  ------------------
  |  Branch (190:9): [True: 0, False: 3.13k]
  ------------------
  191|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  192|      0|        return NULL;
  193|      0|    }
  194|  3.13k|    ret->libctx = libctx;
  195|       |
  196|  3.13k|    return ret;
  197|  3.13k|}
NCONF_new:
  200|  3.13k|{
  201|  3.13k|    return NCONF_new_ex(NULL, meth);
  202|  3.13k|}
NCONF_free:
  205|  3.13k|{
  206|  3.13k|    if (conf == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 3.13k]
  ------------------
  207|      0|        return;
  208|  3.13k|    conf->meth->destroy(conf);
  209|  3.13k|}
NCONF_free_data:
  212|  1.14k|{
  213|  1.14k|    if (conf == NULL)
  ------------------
  |  Branch (213:9): [True: 0, False: 1.14k]
  ------------------
  214|      0|        return;
  215|  1.14k|    conf->meth->destroy_data(conf);
  216|  1.14k|}
NCONF_load_bio:
  276|  3.13k|{
  277|  3.13k|    if (conf == NULL) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.13k]
  ------------------
  278|      0|        ERR_raise(ERR_LIB_CONF, CONF_R_NO_CONF);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  279|      0|        return 0;
  280|      0|    }
  281|       |
  282|  3.13k|    return conf->meth->load_bio(conf, bp, eline);
  283|  3.13k|}

CONF_modules_unload:
  484|      2|{
  485|      2|    int i;
  486|      2|    CONF_MODULE *md;
  487|       |
  488|      2|    if (!conf_modules_finish_int()) /* also inits module list lock */
  ------------------
  |  Branch (488:9): [True: 0, False: 2]
  ------------------
  489|      0|        return;
  490|       |
  491|      2|    if (!CRYPTO_THREAD_write_lock(module_list_lock))
  ------------------
  |  Branch (491:9): [True: 0, False: 2]
  ------------------
  492|      0|        return;
  493|       |
  494|       |    /* unload modules in reverse order */
  495|      2|    for (i = sk_CONF_MODULE_num(supported_modules) - 1; i >= 0; i--) {
  ------------------
  |  Branch (495:57): [True: 0, False: 2]
  ------------------
  496|      0|        md = sk_CONF_MODULE_value(supported_modules, i);
  497|       |        /* If static or in use and 'all' not set ignore it */
  498|      0|        if (((md->links > 0) || !md->dso) && !all)
  ------------------
  |  Branch (498:14): [True: 0, False: 0]
  |  Branch (498:33): [True: 0, False: 0]
  |  Branch (498:46): [True: 0, False: 0]
  ------------------
  499|      0|            continue;
  500|       |        /* Since we're working in reverse this is OK */
  501|      0|        (void)sk_CONF_MODULE_delete(supported_modules, i);
  502|      0|        module_free(md);
  503|      0|    }
  504|       |
  505|      2|    if (sk_CONF_MODULE_num(supported_modules) == 0) {
  ------------------
  |  Branch (505:9): [True: 0, False: 2]
  ------------------
  506|      0|        sk_CONF_MODULE_free(supported_modules);
  507|      0|        supported_modules = NULL;
  508|      0|    }
  509|       |
  510|      2|    CRYPTO_THREAD_unlock(module_list_lock);
  511|      2|}
ossl_config_modules_free:
  578|      2|{
  579|      2|    CONF_modules_unload(1); /* calls CONF_modules_finish */
  580|      2|    module_lists_free();
  581|      2|}
conf_mod.c:do_init_module_list_lock:
  100|      2|{
  101|      2|    module_list_lock = CRYPTO_THREAD_lock_new();
  102|      2|    if (module_list_lock == NULL) {
  ------------------
  |  Branch (102:9): [True: 0, False: 2]
  ------------------
  103|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  104|      0|        return 0;
  105|      0|    }
  106|       |
  107|      2|    return 1;
  108|      2|}
conf_mod.c:conf_modules_finish_int:
  524|      2|{
  525|      2|    CONF_IMODULE *imod;
  526|       |
  527|      2|    if (!RUN_ONCE(&init_module_list_lock, do_init_module_list_lock))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (527:9): [True: 0, False: 2]
  ------------------
  528|      0|        return 0;
  529|       |
  530|       |    /* If module_list_lock is NULL here it means we were already unloaded */
  531|      2|    if (module_list_lock == NULL
  ------------------
  |  Branch (531:9): [True: 0, False: 2]
  ------------------
  532|      2|        || !CRYPTO_THREAD_write_lock(module_list_lock))
  ------------------
  |  Branch (532:12): [True: 0, False: 2]
  ------------------
  533|      0|        return 0;
  534|       |
  535|      2|    while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  ------------------
  |  Branch (535:12): [True: 0, False: 2]
  ------------------
  536|      0|        imod = sk_CONF_IMODULE_pop(initialized_modules);
  537|      0|        module_finish(imod);
  538|      0|    }
  539|      2|    sk_CONF_IMODULE_free(initialized_modules);
  540|      2|    initialized_modules = NULL;
  541|       |
  542|      2|    CRYPTO_THREAD_unlock(module_list_lock);
  543|       |
  544|      2|    return 1;
  545|      2|}
conf_mod.c:module_lists_free:
   88|      2|{
   89|      2|    CRYPTO_THREAD_lock_free(module_list_lock);
   90|      2|    module_list_lock = NULL;
   91|       |
   92|      2|    sk_CONF_MODULE_free(supported_modules);
   93|      2|    supported_modules = NULL;
   94|       |
   95|      2|    sk_CONF_IMODULE_free(initialized_modules);
   96|      2|    initialized_modules = NULL;
   97|      2|}

ossl_lib_ctx_default_deinit:
  159|      2|{
  160|      2|    context_deinit(&default_context_int);
  161|      2|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  162|      2|}
ossl_lib_ctx_get_concrete:
  292|  6.80k|{
  293|  6.80k|#ifndef FIPS_MODULE
  294|  6.80k|    if (ctx == NULL)
  ------------------
  |  Branch (294:9): [True: 6.77k, False: 29]
  ------------------
  295|  6.77k|        return get_default_context();
  296|     29|#endif
  297|     29|    return ctx;
  298|  6.80k|}
ossl_lib_ctx_get_data:
  369|     16|{
  370|     16|    void *data = NULL;
  371|     16|    int dynidx;
  372|       |
  373|     16|    ctx = ossl_lib_ctx_get_concrete(ctx);
  374|     16|    if (ctx == NULL)
  ------------------
  |  Branch (374:9): [True: 0, False: 16]
  ------------------
  375|      0|        return NULL;
  376|       |
  377|     16|    if (!CRYPTO_THREAD_read_lock(ctx->lock))
  ------------------
  |  Branch (377:9): [True: 0, False: 16]
  ------------------
  378|      0|        return NULL;
  379|     16|    dynidx = ctx->dyn_indexes[index];
  380|     16|    CRYPTO_THREAD_unlock(ctx->lock);
  381|       |
  382|     16|    if (dynidx != -1) {
  ------------------
  |  Branch (382:9): [True: 14, False: 2]
  ------------------
  383|     14|        if (!CRYPTO_THREAD_read_lock(ctx->index_locks[index]))
  ------------------
  |  Branch (383:13): [True: 0, False: 14]
  ------------------
  384|      0|            return NULL;
  385|     14|        if (!CRYPTO_THREAD_read_lock(ctx->lock)) {
  ------------------
  |  Branch (385:13): [True: 0, False: 14]
  ------------------
  386|      0|            CRYPTO_THREAD_unlock(ctx->index_locks[index]);
  387|      0|            return NULL;
  388|      0|        }
  389|     14|        data = CRYPTO_get_ex_data(&ctx->data, dynidx);
  390|     14|        CRYPTO_THREAD_unlock(ctx->lock);
  391|     14|        CRYPTO_THREAD_unlock(ctx->index_locks[index]);
  392|     14|        return data;
  393|     14|    }
  394|       |
  395|      2|    if (!CRYPTO_THREAD_write_lock(ctx->index_locks[index]))
  ------------------
  |  Branch (395:9): [True: 0, False: 2]
  ------------------
  396|      0|        return NULL;
  397|      2|    if (!CRYPTO_THREAD_write_lock(ctx->lock)) {
  ------------------
  |  Branch (397:9): [True: 0, False: 2]
  ------------------
  398|      0|        CRYPTO_THREAD_unlock(ctx->index_locks[index]);
  399|      0|        return NULL;
  400|      0|    }
  401|       |
  402|      2|    dynidx = ctx->dyn_indexes[index];
  403|      2|    if (dynidx != -1) {
  ------------------
  |  Branch (403:9): [True: 0, False: 2]
  ------------------
  404|      0|        data = CRYPTO_get_ex_data(&ctx->data, dynidx);
  405|      0|        CRYPTO_THREAD_unlock(ctx->lock);
  406|      0|        CRYPTO_THREAD_unlock(ctx->index_locks[index]);
  407|      0|        return data;
  408|      0|    }
  409|       |
  410|      2|    if (!ossl_lib_ctx_init_index(ctx, index, meth)) {
  ------------------
  |  Branch (410:9): [True: 0, False: 2]
  ------------------
  411|      0|        CRYPTO_THREAD_unlock(ctx->lock);
  412|      0|        CRYPTO_THREAD_unlock(ctx->index_locks[index]);
  413|      0|        return NULL;
  414|      0|    }
  415|       |
  416|      2|    CRYPTO_THREAD_unlock(ctx->lock);
  417|       |
  418|       |    /*
  419|       |     * The alloc call ensures there's a value there. We release the ctx->lock
  420|       |     * for this, because the allocation itself may recursively call
  421|       |     * ossl_lib_ctx_get_data for other indexes (never this one). The allocation
  422|       |     * will itself aquire the ctx->lock when it actually comes to store the
  423|       |     * allocated data (see ossl_lib_ctx_generic_new() above). We call
  424|       |     * ossl_crypto_alloc_ex_data_intern() here instead of CRYPTO_alloc_ex_data().
  425|       |     * They do the same thing except that the latter calls CRYPTO_get_ex_data()
  426|       |     * as well - which we must not do without holding the ctx->lock.
  427|       |     */
  428|      2|    if (ossl_crypto_alloc_ex_data_intern(CRYPTO_EX_INDEX_OSSL_LIB_CTX, NULL,
  ------------------
  |  |  234|      2|# define CRYPTO_EX_INDEX_OSSL_LIB_CTX    16
  ------------------
  |  Branch (428:9): [True: 2, False: 0]
  ------------------
  429|      2|                                         &ctx->data, ctx->dyn_indexes[index])) {
  430|      2|        if (!CRYPTO_THREAD_read_lock(ctx->lock))
  ------------------
  |  Branch (430:13): [True: 0, False: 2]
  ------------------
  431|      0|            goto end;
  432|      2|        data = CRYPTO_get_ex_data(&ctx->data, ctx->dyn_indexes[index]);
  433|      2|        CRYPTO_THREAD_unlock(ctx->lock);
  434|      2|    }
  435|       |
  436|      2|end:
  437|      2|    CRYPTO_THREAD_unlock(ctx->index_locks[index]);
  438|      2|    return data;
  439|      2|}
ossl_lib_ctx_get_ex_data_global:
  442|  6.78k|{
  443|  6.78k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  444|  6.78k|    if (ctx == NULL)
  ------------------
  |  Branch (444:9): [True: 0, False: 6.78k]
  ------------------
  445|      0|        return NULL;
  446|  6.78k|    return &ctx->global;
  447|  6.78k|}
context.c:context_deinit:
  118|      2|{
  119|      2|    struct ossl_lib_ctx_onfree_list_st *tmp, *onfree;
  120|      2|    int i;
  121|       |
  122|      2|    if (ctx == NULL)
  ------------------
  |  Branch (122:9): [True: 0, False: 2]
  ------------------
  123|      0|        return 1;
  124|       |
  125|      2|    ossl_ctx_thread_stop(ctx);
  126|       |
  127|      2|    onfree = ctx->onfreelist;
  128|      2|    while (onfree != NULL) {
  ------------------
  |  Branch (128:12): [True: 0, False: 2]
  ------------------
  129|      0|        onfree->fn(ctx);
  130|      0|        tmp = onfree;
  131|      0|        onfree = onfree->next;
  132|      0|        OPENSSL_free(tmp);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  133|      0|    }
  134|      2|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_OSSL_LIB_CTX, NULL, &ctx->data);
  ------------------
  |  |  234|      2|# define CRYPTO_EX_INDEX_OSSL_LIB_CTX    16
  ------------------
  135|      2|    ossl_crypto_cleanup_all_ex_data_int(ctx);
  136|     40|    for (i = 0; i < OSSL_LIB_CTX_MAX_INDEXES; i++)
  ------------------
  |  |  171|     40|# define OSSL_LIB_CTX_MAX_INDEXES                   19
  ------------------
  |  Branch (136:17): [True: 38, False: 2]
  ------------------
  137|     38|        CRYPTO_THREAD_lock_free(ctx->index_locks[i]);
  138|       |
  139|      2|    CRYPTO_THREAD_lock_free(ctx->oncelock);
  140|      2|    CRYPTO_THREAD_lock_free(ctx->lock);
  141|      2|    ctx->lock = NULL;
  142|      2|    return 1;
  143|      2|}
context.c:context_init:
   73|      2|{
   74|      2|    size_t i;
   75|      2|    int exdata_done = 0;
   76|       |
   77|      2|    ctx->lock = CRYPTO_THREAD_lock_new();
   78|      2|    if (ctx->lock == NULL)
  ------------------
  |  Branch (78:9): [True: 0, False: 2]
  ------------------
   79|      0|        return 0;
   80|       |
   81|      2|    ctx->oncelock = CRYPTO_THREAD_lock_new();
   82|      2|    if (ctx->oncelock == NULL)
  ------------------
  |  Branch (82:9): [True: 0, False: 2]
  ------------------
   83|      0|        goto err;
   84|       |
   85|     40|    for (i = 0; i < OSSL_LIB_CTX_MAX_INDEXES; i++) {
  ------------------
  |  |  171|     40|# define OSSL_LIB_CTX_MAX_INDEXES                   19
  ------------------
  |  Branch (85:17): [True: 38, False: 2]
  ------------------
   86|     38|        ctx->index_locks[i] = CRYPTO_THREAD_lock_new();
   87|     38|        ctx->dyn_indexes[i] = -1;
   88|     38|        if (ctx->index_locks[i] == NULL)
  ------------------
  |  Branch (88:13): [True: 0, False: 38]
  ------------------
   89|      0|            goto err;
   90|     38|    }
   91|       |
   92|       |    /* OSSL_LIB_CTX is built on top of ex_data so we initialise that directly */
   93|      2|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (93:9): [True: 0, False: 2]
  ------------------
   94|      0|        goto err;
   95|      2|    exdata_done = 1;
   96|       |
   97|      2|    if (!ossl_crypto_new_ex_data_ex(ctx, CRYPTO_EX_INDEX_OSSL_LIB_CTX, NULL,
  ------------------
  |  |  234|      2|# define CRYPTO_EX_INDEX_OSSL_LIB_CTX    16
  ------------------
  |  Branch (97:9): [True: 0, False: 2]
  ------------------
   98|      2|                                    &ctx->data))
   99|      0|        goto err;
  100|       |
  101|       |    /* Everything depends on properties, so we also pre-initialise that */
  102|      2|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (102:9): [True: 0, False: 2]
  ------------------
  103|      0|        goto err;
  104|       |
  105|      2|    return 1;
  106|      0| err:
  107|      0|    if (exdata_done)
  ------------------
  |  Branch (107:9): [True: 0, False: 0]
  ------------------
  108|      0|        ossl_crypto_cleanup_all_ex_data_int(ctx);
  109|      0|    for (i = 0; i < OSSL_LIB_CTX_MAX_INDEXES; i++)
  ------------------
  |  |  171|      0|# define OSSL_LIB_CTX_MAX_INDEXES                   19
  ------------------
  |  Branch (109:17): [True: 0, False: 0]
  ------------------
  110|      0|        CRYPTO_THREAD_lock_free(ctx->index_locks[i]);
  111|      0|    CRYPTO_THREAD_lock_free(ctx->oncelock);
  112|      0|    CRYPTO_THREAD_lock_free(ctx->lock);
  113|      0|    memset(ctx, '\0', sizeof(*ctx));
  114|      0|    return 0;
  115|      2|}
context.c:default_context_do_init:
  153|      2|{
  154|      2|    return CRYPTO_THREAD_init_local(&default_context_thread_local, NULL)
  ------------------
  |  Branch (154:12): [True: 2, False: 0]
  ------------------
  155|      2|        && context_init(&default_context_int);
  ------------------
  |  Branch (155:12): [True: 2, False: 0]
  ------------------
  156|      2|}
context.c:get_default_context:
  173|  6.77k|{
  174|  6.77k|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  175|       |
  176|  6.77k|    if (current_defctx == NULL)
  ------------------
  |  Branch (176:9): [True: 6.77k, False: 0]
  ------------------
  177|  6.77k|        current_defctx = &default_context_int;
  178|  6.77k|    return current_defctx;
  179|  6.77k|}
context.c:get_thread_default_context:
  165|  6.77k|{
  166|  6.77k|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|  6.77k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 6.77k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (166:9): [True: 0, False: 6.77k]
  ------------------
  167|      0|        return NULL;
  168|       |
  169|  6.77k|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  170|  6.77k|}
context.c:ossl_lib_ctx_init_index:
  348|      2|{
  349|      2|    int idx;
  350|       |
  351|      2|    ctx = ossl_lib_ctx_get_concrete(ctx);
  352|      2|    if (ctx == NULL)
  ------------------
  |  Branch (352:9): [True: 0, False: 2]
  ------------------
  353|      0|        return 0;
  354|       |
  355|      2|    idx = ossl_crypto_get_ex_new_index_ex(ctx, CRYPTO_EX_INDEX_OSSL_LIB_CTX, 0,
  ------------------
  |  |  234|      2|# define CRYPTO_EX_INDEX_OSSL_LIB_CTX    16
  ------------------
  356|      2|                                          (void *)meth,
  357|      2|                                          ossl_lib_ctx_generic_new,
  358|      2|                                          NULL, ossl_lib_ctx_generic_free,
  359|      2|                                          meth->priority);
  360|      2|    if (idx < 0)
  ------------------
  |  Branch (360:9): [True: 0, False: 2]
  ------------------
  361|      0|        return 0;
  362|       |
  363|      2|    ctx->dyn_indexes[static_index] = idx;
  364|      2|    return 1;
  365|      2|}
context.c:ossl_lib_ctx_generic_new:
  321|      2|{
  322|      2|    const OSSL_LIB_CTX_METHOD *meth = argp;
  323|      2|    OSSL_LIB_CTX *ctx = ossl_crypto_ex_data_get_ossl_lib_ctx(ad);
  324|      2|    void *ptr = meth->new_func(ctx);
  325|       |
  326|      2|    if (ptr != NULL) {
  ------------------
  |  Branch (326:9): [True: 2, False: 0]
  ------------------
  327|      2|        if (!CRYPTO_THREAD_write_lock(ctx->lock))
  ------------------
  |  Branch (327:13): [True: 0, False: 2]
  ------------------
  328|       |            /*
  329|       |             * Can't return something, so best to hope that something will
  330|       |             * fail later. :(
  331|       |             */
  332|      0|            return;
  333|      2|        CRYPTO_set_ex_data(ad, index, ptr);
  334|      2|        CRYPTO_THREAD_unlock(ctx->lock);
  335|      2|    }
  336|      2|}
context.c:ossl_lib_ctx_generic_free:
  340|      2|{
  341|      2|    const OSSL_LIB_CTX_METHOD *meth = argp;
  342|       |
  343|      2|    meth->free_func(ptr);
  344|      2|}

ossl_err_load_CRYPTO_strings:
   64|      2|{
   65|      2|#ifndef OPENSSL_NO_ERR
   66|      2|    if (ERR_reason_error_string(CRYPTO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (66:9): [True: 2, False: 0]
  ------------------
   67|      2|        ERR_load_strings_const(CRYPTO_str_reasons);
   68|      2|#endif
   69|      2|    return 1;
   70|      2|}

OPENSSL_cpuid_setup:
   96|      4|{
   97|      4|    static int trigger = 0;
   98|      4|    IA32CAP OPENSSL_ia32_cpuid(unsigned int *);
   99|      4|    IA32CAP vec;
  100|      4|    const variant_char *env;
  101|       |
  102|      4|    if (trigger)
  ------------------
  |  Branch (102:9): [True: 2, False: 2]
  ------------------
  103|      2|        return;
  104|       |
  105|      2|    trigger = 1;
  106|      2|    if ((env = ossl_getenv("OPENSSL_ia32cap")) != NULL) {
  ------------------
  |  |   47|      2|#   define ossl_getenv getenv
  ------------------
  |  Branch (106:9): [True: 0, False: 2]
  ------------------
  107|      0|        int off = (env[0] == '~') ? 1 : 0;
  ------------------
  |  Branch (107:19): [True: 0, False: 0]
  ------------------
  108|       |
  109|      0|        vec = ossl_strtouint64(env + off);
  110|       |
  111|      0|        if (off) {
  ------------------
  |  Branch (111:13): [True: 0, False: 0]
  ------------------
  112|      0|            IA32CAP mask = vec;
  113|      0|            vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P) & ~mask;
  114|      0|            if (mask & (1<<24)) {
  ------------------
  |  Branch (114:17): [True: 0, False: 0]
  ------------------
  115|       |                /*
  116|       |                 * User disables FXSR bit, mask even other capabilities
  117|       |                 * that operate exclusively on XMM, so we don't have to
  118|       |                 * double-check all the time. We mask PCLMULQDQ, AMD XOP,
  119|       |                 * AES-NI and AVX. Formally speaking we don't have to
  120|       |                 * do it in x86_64 case, but we can safely assume that
  121|       |                 * x86_64 users won't actually flip this flag.
  122|       |                 */
  123|      0|                vec &= ~((IA32CAP)(1<<1|1<<11|1<<25|1<<28) << 32);
  124|      0|            }
  125|      0|        } else if (env[0] == ':') {
  ------------------
  |  Branch (125:20): [True: 0, False: 0]
  ------------------
  126|      0|            vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  127|      0|        }
  128|       |
  129|      0|        if ((env = ossl_strchr(env, ':')) != NULL) {
  ------------------
  |  Branch (129:13): [True: 0, False: 0]
  ------------------
  130|      0|            IA32CAP vecx;
  131|       |
  132|      0|            env++;
  133|      0|            off = (env[0] == '~') ? 1 : 0;
  ------------------
  |  Branch (133:19): [True: 0, False: 0]
  ------------------
  134|      0|            vecx = ossl_strtouint64(env + off);
  135|      0|            if (off) {
  ------------------
  |  Branch (135:17): [True: 0, False: 0]
  ------------------
  136|      0|                OPENSSL_ia32cap_P[2] &= ~(unsigned int)vecx;
  137|      0|                OPENSSL_ia32cap_P[3] &= ~(unsigned int)(vecx >> 32);
  138|      0|            } else {
  139|      0|                OPENSSL_ia32cap_P[2] = (unsigned int)vecx;
  140|      0|                OPENSSL_ia32cap_P[3] = (unsigned int)(vecx >> 32);
  141|      0|            }
  142|      0|        } else {
  143|      0|            OPENSSL_ia32cap_P[2] = 0;
  144|      0|            OPENSSL_ia32cap_P[3] = 0;
  145|      0|        }
  146|      2|    } else {
  147|      2|        vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  148|      2|    }
  149|       |
  150|       |    /*
  151|       |     * |(1<<10) sets a reserved bit to signal that variable
  152|       |     * was initialized already... This is to avoid interference
  153|       |     * with cpuid snippets in ELF .init segment.
  154|       |     */
  155|      2|    OPENSSL_ia32cap_P[0] = (unsigned int)vec | (1 << 10);
  156|      2|    OPENSSL_ia32cap_P[1] = (unsigned int)(vec >> 32);
  157|      2|}

ossl_err_load_CRMF_strings:
   65|      2|{
   66|      2|# ifndef OPENSSL_NO_ERR
   67|      2|    if (ERR_reason_error_string(CRMF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (67:9): [True: 2, False: 0]
  ------------------
   68|      2|        ERR_load_strings_const(CRMF_str_reasons);
   69|      2|# endif
   70|      2|    return 1;
   71|      2|}

ossl_err_load_CT_strings:
   52|      2|{
   53|      2|# ifndef OPENSSL_NO_ERR
   54|      2|    if (ERR_reason_error_string(CT_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (54:9): [True: 2, False: 0]
  ------------------
   55|      2|        ERR_load_strings_const(CT_str_reasons);
   56|      2|# endif
   57|      2|    return 1;
   58|      2|}

ossl_isdigit:
  270|  4.02k|{
  271|  4.02k|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  4.02k|#  define ossl_toascii(c)       (c)
  ------------------
  272|       |
  273|  4.02k|    return ASCII_IS_DIGIT(a);
  ------------------
  |  |  265|  4.02k|#define ASCII_IS_DIGIT(c)   (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:30): [True: 4.02k, False: 0]
  |  |  |  Branch (265:43): [True: 0, False: 4.02k]
  |  |  ------------------
  ------------------
  274|  4.02k|}
ossl_tolower:
  297|   119k|{
  298|   119k|    int a = ossl_toascii(c);
  ------------------
  |  |   56|   119k|#  define ossl_toascii(c)       (c)
  ------------------
  299|       |
  300|   119k|    return ASCII_IS_UPPER(a) ? c ^ case_change : c;
  ------------------
  |  |  266|   119k|#define ASCII_IS_UPPER(c)   (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:30): [True: 64.9k, False: 54.5k]
  |  |  |  Branch (266:43): [True: 1.64k, False: 63.2k]
  |  |  ------------------
  ------------------
  301|   119k|}

ossl_err_load_DH_strings:
   66|      2|{
   67|      2|# ifndef OPENSSL_NO_ERR
   68|      2|    if (ERR_reason_error_string(DH_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (68:9): [True: 2, False: 0]
  ------------------
   69|      2|        ERR_load_strings_const(DH_str_reasons);
   70|      2|# endif
   71|      2|    return 1;
   72|      2|}

ossl_err_load_DSA_strings:
   46|      2|{
   47|      2|# ifndef OPENSSL_NO_ERR
   48|      2|    if (ERR_reason_error_string(DSA_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (48:9): [True: 2, False: 0]
  ------------------
   49|      2|        ERR_load_strings_const(DSA_str_reasons);
   50|      2|# endif
   51|      2|    return 1;
   52|      2|}

ossl_err_load_DSO_strings:
   50|      2|{
   51|      2|#ifndef OPENSSL_NO_ERR
   52|      2|    if (ERR_reason_error_string(DSO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 2, False: 0]
  ------------------
   53|      2|        ERR_load_strings_const(DSO_str_reasons);
   54|      2|#endif
   55|      2|    return 1;
   56|      2|}

ossl_err_load_EC_strings:
  127|      2|{
  128|      2|# ifndef OPENSSL_NO_ERR
  129|      2|    if (ERR_reason_error_string(EC_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (129:9): [True: 2, False: 0]
  ------------------
  130|      2|        ERR_load_strings_const(EC_str_reasons);
  131|      2|# endif
  132|      2|    return 1;
  133|      2|}

ossl_err_load_ENGINE_strings:
   85|      2|{
   86|      2|# ifndef OPENSSL_NO_ERR
   87|      2|    if (ERR_reason_error_string(ENGINE_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (87:9): [True: 2, False: 0]
  ------------------
   88|      2|        ERR_load_strings_const(ENGINE_str_reasons);
   89|      2|# endif
   90|      2|    return 1;
   91|      2|}

engine_cleanup_int:
  174|      2|{
  175|      2|    if (int_cleanup_check(0)) {
  ------------------
  |  Branch (175:9): [True: 0, False: 2]
  ------------------
  176|      0|        sk_ENGINE_CLEANUP_ITEM_pop_free(cleanup_stack,
  177|      0|                                        engine_cleanup_cb_free);
  178|      0|        cleanup_stack = NULL;
  179|      0|    }
  180|      2|    CRYPTO_THREAD_lock_free(global_engine_lock);
  181|      2|    global_engine_lock = NULL;
  182|      2|}
eng_lib.c:int_cleanup_check:
  115|      2|{
  116|      2|    if (cleanup_stack)
  ------------------
  |  Branch (116:9): [True: 0, False: 2]
  ------------------
  117|      0|        return 1;
  118|      2|    if (!create)
  ------------------
  |  Branch (118:9): [True: 2, False: 0]
  ------------------
  119|      2|        return 0;
  120|      0|    cleanup_stack = sk_ENGINE_CLEANUP_ITEM_new_null();
  121|      0|    return (cleanup_stack ? 1 : 0);
  ------------------
  |  Branch (121:13): [True: 0, False: 0]
  ------------------
  122|      2|}

err_cleanup:
  234|      2|{
  235|      2|    if (set_err_thread_local != 0)
  ------------------
  |  Branch (235:9): [True: 2, False: 0]
  ------------------
  236|      2|        CRYPTO_THREAD_cleanup_local(&err_thread_local);
  237|      2|    CRYPTO_THREAD_lock_free(err_string_lock);
  238|      2|    err_string_lock = NULL;
  239|      2|#ifndef OPENSSL_NO_ERR
  240|      2|    lh_ERR_STRING_DATA_free(int_error_hash);
  ------------------
  |  |  376|      2|#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh))
  ------------------
  241|      2|    int_error_hash = NULL;
  242|      2|#endif
  243|      2|}
ossl_err_load_ERR_strings:
  273|     70|{
  274|     70|#ifndef OPENSSL_NO_ERR
  275|     70|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|     70|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 70, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (275:9): [True: 0, False: 70]
  ------------------
  276|      0|        return 0;
  277|       |
  278|     70|    err_load_strings(ERR_str_libraries);
  279|     70|    err_load_strings(ERR_str_reasons);
  280|     70|#endif
  281|     70|    return 1;
  282|     70|}
ERR_load_strings_const:
  298|     68|{
  299|     68|#ifndef OPENSSL_NO_ERR
  300|     68|    if (ossl_err_load_ERR_strings() == 0)
  ------------------
  |  Branch (300:9): [True: 0, False: 68]
  ------------------
  301|      0|        return 0;
  302|     68|    err_load_strings(str);
  303|     68|#endif
  304|       |
  305|     68|    return 1;
  306|     68|}
ERR_clear_error:
  336|  3.13k|{
  337|  3.13k|    int i;
  338|  3.13k|    ERR_STATE *es;
  339|       |
  340|  3.13k|    es = ossl_err_get_state_int();
  341|  3.13k|    if (es == NULL)
  ------------------
  |  Branch (341:9): [True: 0, False: 3.13k]
  ------------------
  342|      0|        return;
  343|       |
  344|  53.2k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|  53.2k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (344:17): [True: 50.1k, False: 3.13k]
  ------------------
  345|  50.1k|        err_clear(es, i, 0);
  346|  50.1k|    }
  347|  3.13k|    es->top = es->bottom = 0;
  348|  3.13k|}
ERR_reason_error_string:
  613|     68|{
  614|     68|#ifndef OPENSSL_NO_ERR
  615|     68|    ERR_STRING_DATA d, *p = NULL;
  616|     68|    unsigned long l, r;
  617|       |
  618|     68|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|     68|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 68, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:9): [True: 0, False: 68]
  ------------------
  619|      0|        return NULL;
  620|      0|    }
  621|       |
  622|       |    /*
  623|       |     * ERR_reason_error_string() can't safely return system error strings,
  624|       |     * since openssl_strerror_r() needs a buffer for thread safety, and we
  625|       |     * haven't got one that would serve any sensible purpose.
  626|       |     */
  627|     68|    if (ERR_SYSTEM_ERROR(e))
  ------------------
  |  |  239|     68|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     68|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 68]
  |  |  ------------------
  ------------------
  628|      0|        return NULL;
  629|       |
  630|     68|    l = ERR_GET_LIB(e);
  631|     68|    r = ERR_GET_REASON(e);
  632|     68|    d.error = ERR_PACK(l, 0, r);
  ------------------
  |  |  279|     68|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     68|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     68|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     68|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     68|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  633|     68|    p = int_err_get_item(&d);
  634|     68|    if (p == NULL) {
  ------------------
  |  Branch (634:9): [True: 68, False: 0]
  ------------------
  635|     68|        d.error = ERR_PACK(0, 0, r);
  ------------------
  |  |  279|     68|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     68|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     68|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     68|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     68|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  636|     68|        p = int_err_get_item(&d);
  637|     68|    }
  638|     68|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (638:13): [True: 68, False: 0]
  ------------------
  639|       |#else
  640|       |    return NULL;
  641|       |#endif
  642|     68|}
ossl_err_get_state_int:
  673|  20.0k|{
  674|  20.0k|    ERR_STATE *state;
  675|  20.0k|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  20.0k|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  20.0k|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  20.0k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 20.0k]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|  20.0k|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  20.0k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 20.0k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 20.0k]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  20.0k|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  20.0k|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 20.0k]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  20.0k|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 2, False: 20.0k]
  ------------------
  688|      2|        if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (688:13): [True: 0, False: 2]
  ------------------
  689|      0|            return NULL;
  690|       |
  691|      2|        if ((state = OPENSSL_zalloc(sizeof(*state))) == NULL) {
  ------------------
  |  |   98|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (691:13): [True: 0, False: 2]
  ------------------
  692|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  693|      0|            return NULL;
  694|      0|        }
  695|       |
  696|      2|        if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state)
  ------------------
  |  Branch (696:13): [True: 0, False: 2]
  ------------------
  697|      2|                || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
  ------------------
  |  Branch (697:20): [True: 0, False: 2]
  ------------------
  698|      0|            ERR_STATE_free(state);
  699|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  700|      0|            return NULL;
  701|      0|        }
  702|       |
  703|       |        /* Ignore failures from these */
  704|      2|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  449|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  705|      2|    }
  706|       |
  707|  20.0k|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  20.0k|# define set_sys_error(e)        errno=(e)
  ------------------
  708|  20.0k|    return state;
  709|  20.0k|}
ERR_add_error_data:
  812|  1.14k|{
  813|  1.14k|    va_list args;
  814|  1.14k|    va_start(args, num);
  815|  1.14k|    ERR_add_error_vdata(num, args);
  816|  1.14k|    va_end(args);
  817|  1.14k|}
ERR_add_error_vdata:
  820|  1.14k|{
  821|  1.14k|    int i, len, size;
  822|  1.14k|    int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|  1.14k|# define ERR_TXT_MALLOCED        0x01
  ------------------
                  int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|  1.14k|# define ERR_TXT_STRING          0x02
  ------------------
  823|  1.14k|    char *str, *arg;
  824|  1.14k|    ERR_STATE *es;
  825|       |
  826|       |    /* Get the current error data; if an allocated string get it. */
  827|  1.14k|    es = ossl_err_get_state_int();
  828|  1.14k|    if (es == NULL)
  ------------------
  |  Branch (828:9): [True: 0, False: 1.14k]
  ------------------
  829|      0|        return;
  830|  1.14k|    i = es->top;
  831|       |
  832|       |    /*
  833|       |     * If err_data is allocated already, re-use the space.
  834|       |     * Otherwise, allocate a small new buffer.
  835|       |     */
  836|  1.14k|    if ((es->err_data_flags[i] & flags) == flags) {
  ------------------
  |  Branch (836:9): [True: 702, False: 446]
  ------------------
  837|    702|        str = es->err_data[i];
  838|    702|        size = es->err_data_size[i];
  839|       |
  840|       |        /*
  841|       |         * To protect the string we just grabbed from tampering by other
  842|       |         * functions we may call, or to protect them from freeing a pointer
  843|       |         * that may no longer be valid at that point, we clear away the
  844|       |         * data pointer and the flags.  We will set them again at the end
  845|       |         * of this function.
  846|       |         */
  847|    702|        es->err_data[i] = NULL;
  848|    702|        es->err_data_flags[i] = 0;
  849|    702|    } else if ((str = OPENSSL_malloc(size = 81)) == NULL) {
  ------------------
  |  |   96|    446|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|    446|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|    446|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (849:16): [True: 0, False: 446]
  ------------------
  850|      0|        return;
  851|    446|    } else {
  852|    446|        str[0] = '\0';
  853|    446|    }
  854|  1.14k|    len = strlen(str);
  855|       |
  856|  3.44k|    while (--num >= 0) {
  ------------------
  |  Branch (856:12): [True: 2.29k, False: 1.14k]
  ------------------
  857|  2.29k|        arg = va_arg(args, char *);
  858|  2.29k|        if (arg == NULL)
  ------------------
  |  Branch (858:13): [True: 0, False: 2.29k]
  ------------------
  859|      0|            arg = "<NULL>";
  860|  2.29k|        len += strlen(arg);
  861|  2.29k|        if (len >= size) {
  ------------------
  |  Branch (861:13): [True: 702, False: 1.59k]
  ------------------
  862|    702|            char *p;
  863|       |
  864|    702|            size = len + 20;
  865|    702|            p = OPENSSL_realloc(str, size);
  ------------------
  |  |  100|    702|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|    702|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|    702|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  866|    702|            if (p == NULL) {
  ------------------
  |  Branch (866:17): [True: 0, False: 702]
  ------------------
  867|      0|                OPENSSL_free(str);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  868|      0|                return;
  869|      0|            }
  870|    702|            str = p;
  871|    702|        }
  872|  2.29k|        OPENSSL_strlcat(str, arg, (size_t)size);
  873|  2.29k|    }
  874|  1.14k|    if (!err_set_error_data_int(str, size, flags, 0))
  ------------------
  |  Branch (874:9): [True: 0, False: 1.14k]
  ------------------
  875|      0|        OPENSSL_free(str);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  876|  1.14k|}
err.c:do_err_strings_init:
  215|      2|{
  216|      2|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (216:9): [True: 0, False: 2]
  ------------------
  217|      0|        return 0;
  218|      2|    err_string_lock = CRYPTO_THREAD_lock_new();
  219|      2|    if (err_string_lock == NULL)
  ------------------
  |  Branch (219:9): [True: 0, False: 2]
  ------------------
  220|      0|        return 0;
  221|      2|#ifndef OPENSSL_NO_ERR
  222|      2|    int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
  ------------------
  |  |  375|      2|#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)))
  ------------------
  223|      2|                                            err_string_data_cmp);
  224|      2|    if (int_error_hash == NULL) {
  ------------------
  |  Branch (224:9): [True: 0, False: 2]
  ------------------
  225|      0|        CRYPTO_THREAD_lock_free(err_string_lock);
  226|      0|        err_string_lock = NULL;
  227|      0|        return 0;
  228|      0|    }
  229|      2|#endif
  230|      2|    return 1;
  231|      2|}
err.c:err_string_data_hash:
  173|  8.55k|{
  174|  8.55k|    unsigned long ret, l;
  175|       |
  176|  8.55k|    l = a->error;
  177|  8.55k|    ret = l ^ ERR_GET_LIB(l);
  178|  8.55k|    return (ret ^ ret % 19 * 13);
  179|  8.55k|}
err.c:err_string_data_cmp:
  183|  5.86k|{
  184|  5.86k|    if (a->error == b->error)
  ------------------
  |  Branch (184:9): [True: 5.57k, False: 288]
  ------------------
  185|  5.57k|        return 0;
  186|    288|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (186:12): [True: 156, False: 132]
  ------------------
  187|  5.86k|}
err.c:err_load_strings:
  261|    208|{
  262|    208|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (262:9): [True: 0, False: 208]
  ------------------
  263|      0|        return 0;
  264|  8.62k|    for (; str->error; str++)
  ------------------
  |  Branch (264:12): [True: 8.41k, False: 208]
  ------------------
  265|  8.41k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  378|  8.62k|#define lh_ERR_STRING_DATA_insert(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_insert(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  266|    208|                                       (ERR_STRING_DATA *)str);
  267|    208|    CRYPTO_THREAD_unlock(err_string_lock);
  268|    208|    return 1;
  269|    208|}
err.c:int_err_get_item:
  190|    136|{
  191|    136|    ERR_STRING_DATA *p = NULL;
  192|       |
  193|    136|    if (!CRYPTO_THREAD_read_lock(err_string_lock))
  ------------------
  |  Branch (193:9): [True: 0, False: 136]
  ------------------
  194|      0|        return NULL;
  195|    136|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  ------------------
  |  |  380|    136|#define lh_ERR_STRING_DATA_retrieve(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_retrieve(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  196|    136|    CRYPTO_THREAD_unlock(err_string_lock);
  197|       |
  198|    136|    return p;
  199|    136|}
err.c:err_do_init:
  667|      2|{
  668|      2|    set_err_thread_local = 1;
  669|      2|    return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
  670|      2|}
err.c:err_delete_thread_state:
  645|      2|{
  646|      2|    ERR_STATE *state = CRYPTO_THREAD_get_local(&err_thread_local);
  647|      2|    if (state == NULL)
  ------------------
  |  Branch (647:9): [True: 0, False: 2]
  ------------------
  648|      0|        return;
  649|       |
  650|      2|    CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  651|      2|    ERR_STATE_free(state);
  652|      2|}
err.c:ERR_STATE_free:
  203|      2|{
  204|      2|    int i;
  205|       |
  206|      2|    if (s == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 2]
  ------------------
  207|      0|        return;
  208|     34|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|     34|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (208:17): [True: 32, False: 2]
  ------------------
  209|     32|        err_clear(s, i, 1);
  210|     32|    }
  211|      2|    OPENSSL_free(s);
  ------------------
  |  |  106|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  212|      2|}
err.c:err_set_error_data_int:
  779|  1.14k|{
  780|  1.14k|    ERR_STATE *es;
  781|       |
  782|  1.14k|    es = ossl_err_get_state_int();
  783|  1.14k|    if (es == NULL)
  ------------------
  |  Branch (783:9): [True: 0, False: 1.14k]
  ------------------
  784|      0|        return 0;
  785|       |
  786|  1.14k|    err_clear_data(es, es->top, deallocate);
  787|  1.14k|    err_set_data(es, es->top, data, size, flags);
  788|       |
  789|  1.14k|    return 1;
  790|  1.14k|}

ossl_err_load_crypto_strings:
   49|      2|{
   50|      2|    if (0
  ------------------
  |  Branch (50:9): [Folded - Ignored]
  ------------------
   51|      2|#ifndef OPENSSL_NO_ERR
   52|      2|        || ossl_err_load_ERR_strings() == 0 /* include error strings for SYSerr */
  ------------------
  |  Branch (52:12): [True: 0, False: 2]
  ------------------
   53|      2|        || ossl_err_load_BN_strings() == 0
  ------------------
  |  Branch (53:12): [True: 0, False: 2]
  ------------------
   54|      2|        || ossl_err_load_RSA_strings() == 0
  ------------------
  |  Branch (54:12): [True: 0, False: 2]
  ------------------
   55|      2|# ifndef OPENSSL_NO_DH
   56|      2|        || ossl_err_load_DH_strings() == 0
  ------------------
  |  Branch (56:12): [True: 0, False: 2]
  ------------------
   57|      2|# endif
   58|      2|        || ossl_err_load_EVP_strings() == 0
  ------------------
  |  Branch (58:12): [True: 0, False: 2]
  ------------------
   59|      2|        || ossl_err_load_BUF_strings() == 0
  ------------------
  |  Branch (59:12): [True: 0, False: 2]
  ------------------
   60|      2|        || ossl_err_load_OBJ_strings() == 0
  ------------------
  |  Branch (60:12): [True: 0, False: 2]
  ------------------
   61|      2|        || ossl_err_load_PEM_strings() == 0
  ------------------
  |  Branch (61:12): [True: 0, False: 2]
  ------------------
   62|      2|# ifndef OPENSSL_NO_DSA
   63|      2|        || ossl_err_load_DSA_strings() == 0
  ------------------
  |  Branch (63:12): [True: 0, False: 2]
  ------------------
   64|      2|# endif
   65|      2|        || ossl_err_load_X509_strings() == 0
  ------------------
  |  Branch (65:12): [True: 0, False: 2]
  ------------------
   66|      2|        || ossl_err_load_ASN1_strings() == 0
  ------------------
  |  Branch (66:12): [True: 0, False: 2]
  ------------------
   67|      2|        || ossl_err_load_CONF_strings() == 0
  ------------------
  |  Branch (67:12): [True: 0, False: 2]
  ------------------
   68|      2|        || ossl_err_load_CRYPTO_strings() == 0
  ------------------
  |  Branch (68:12): [True: 0, False: 2]
  ------------------
   69|      2|# ifndef OPENSSL_NO_COMP
   70|      2|        || ossl_err_load_COMP_strings() == 0
  ------------------
  |  Branch (70:12): [True: 0, False: 2]
  ------------------
   71|      2|# endif
   72|      2|# ifndef OPENSSL_NO_EC
   73|      2|        || ossl_err_load_EC_strings() == 0
  ------------------
  |  Branch (73:12): [True: 0, False: 2]
  ------------------
   74|      2|# endif
   75|       |        /* skip ossl_err_load_SSL_strings() because it is not in this library */
   76|      2|        || ossl_err_load_BIO_strings() == 0
  ------------------
  |  Branch (76:12): [True: 0, False: 2]
  ------------------
   77|      2|        || ossl_err_load_PKCS7_strings() == 0
  ------------------
  |  Branch (77:12): [True: 0, False: 2]
  ------------------
   78|      2|        || ossl_err_load_X509V3_strings() == 0
  ------------------
  |  Branch (78:12): [True: 0, False: 2]
  ------------------
   79|      2|        || ossl_err_load_PKCS12_strings() == 0
  ------------------
  |  Branch (79:12): [True: 0, False: 2]
  ------------------
   80|      2|        || ossl_err_load_RAND_strings() == 0
  ------------------
  |  Branch (80:12): [True: 0, False: 2]
  ------------------
   81|      2|        || ossl_err_load_DSO_strings() == 0
  ------------------
  |  Branch (81:12): [True: 0, False: 2]
  ------------------
   82|      2|# ifndef OPENSSL_NO_TS
   83|      2|        || ossl_err_load_TS_strings() == 0
  ------------------
  |  Branch (83:12): [True: 0, False: 2]
  ------------------
   84|      2|# endif
   85|      2|# ifndef OPENSSL_NO_ENGINE
   86|      2|        || ossl_err_load_ENGINE_strings() == 0
  ------------------
  |  Branch (86:12): [True: 0, False: 2]
  ------------------
   87|      2|# endif
   88|      2|        || ossl_err_load_HTTP_strings() == 0
  ------------------
  |  Branch (88:12): [True: 0, False: 2]
  ------------------
   89|      2|# ifndef OPENSSL_NO_OCSP
   90|      2|        || ossl_err_load_OCSP_strings() == 0
  ------------------
  |  Branch (90:12): [True: 0, False: 2]
  ------------------
   91|      2|# endif
   92|      2|        || ossl_err_load_UI_strings() == 0
  ------------------
  |  Branch (92:12): [True: 0, False: 2]
  ------------------
   93|      2|# ifndef OPENSSL_NO_CMS
   94|      2|        || ossl_err_load_CMS_strings() == 0
  ------------------
  |  Branch (94:12): [True: 0, False: 2]
  ------------------
   95|      2|# endif
   96|      2|# ifndef OPENSSL_NO_CRMF
   97|      2|        || ossl_err_load_CRMF_strings() == 0
  ------------------
  |  Branch (97:12): [True: 0, False: 2]
  ------------------
   98|      2|        || ossl_err_load_CMP_strings() == 0
  ------------------
  |  Branch (98:12): [True: 0, False: 2]
  ------------------
   99|      2|# endif
  100|      2|# ifndef OPENSSL_NO_CT
  101|      2|        || ossl_err_load_CT_strings() == 0
  ------------------
  |  Branch (101:12): [True: 0, False: 2]
  ------------------
  102|      2|# endif
  103|      2|        || ossl_err_load_ESS_strings() == 0
  ------------------
  |  Branch (103:12): [True: 0, False: 2]
  ------------------
  104|      2|        || ossl_err_load_ASYNC_strings() == 0
  ------------------
  |  Branch (104:12): [True: 0, False: 2]
  ------------------
  105|      2|        || ossl_err_load_OSSL_STORE_strings() == 0
  ------------------
  |  Branch (105:12): [True: 0, False: 2]
  ------------------
  106|      2|        || ossl_err_load_PROP_strings() == 0
  ------------------
  |  Branch (106:12): [True: 0, False: 2]
  ------------------
  107|      2|        || ossl_err_load_PROV_strings() == 0
  ------------------
  |  Branch (107:12): [True: 0, False: 2]
  ------------------
  108|      2|#endif
  109|      2|        )
  110|      0|        return 0;
  111|       |
  112|      2|    return 1;
  113|      2|}

ERR_new:
   17|  4.86k|{
   18|  4.86k|    ERR_STATE *es;
   19|       |
   20|  4.86k|    es = ossl_err_get_state_int();
   21|  4.86k|    if (es == NULL)
  ------------------
  |  Branch (21:9): [True: 0, False: 4.86k]
  ------------------
   22|      0|        return;
   23|       |
   24|       |    /* Allocate a slot */
   25|  4.86k|    err_get_slot(es);
   26|  4.86k|    err_clear(es, es->top, 0);
   27|  4.86k|}
ERR_set_debug:
   30|  4.86k|{
   31|  4.86k|    ERR_STATE *es;
   32|       |
   33|  4.86k|    es = ossl_err_get_state_int();
   34|  4.86k|    if (es == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 4.86k]
  ------------------
   35|      0|        return;
   36|       |
   37|  4.86k|    err_set_debug(es, es->top, file, line, func);
   38|  4.86k|}
ERR_set_error:
   41|  4.86k|{
   42|  4.86k|    va_list args;
   43|       |
   44|  4.86k|    va_start(args, fmt);
   45|  4.86k|    ERR_vset_error(lib, reason, fmt, args);
   46|  4.86k|    va_end(args);
   47|  4.86k|}
ERR_vset_error:
   50|  4.86k|{
   51|  4.86k|    ERR_STATE *es;
   52|  4.86k|    char *buf = NULL;
   53|  4.86k|    size_t buf_size = 0;
   54|  4.86k|    unsigned long flags = 0;
   55|  4.86k|    size_t i;
   56|       |
   57|  4.86k|    es = ossl_err_get_state_int();
   58|  4.86k|    if (es == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 4.86k]
  ------------------
   59|      0|        return;
   60|  4.86k|    i = es->top;
   61|       |
   62|  4.86k|    if (fmt != NULL) {
  ------------------
  |  Branch (62:9): [True: 2.87k, False: 1.98k]
  ------------------
   63|  2.87k|        int printed_len = 0;
   64|  2.87k|        char *rbuf = NULL;
   65|       |
   66|  2.87k|        buf = es->err_data[i];
   67|  2.87k|        buf_size = es->err_data_size[i];
   68|       |
   69|       |        /*
   70|       |         * To protect the string we just grabbed from tampering by other
   71|       |         * functions we may call, or to protect them from freeing a pointer
   72|       |         * that may no longer be valid at that point, we clear away the
   73|       |         * data pointer and the flags.  We will set them again at the end
   74|       |         * of this function.
   75|       |         */
   76|  2.87k|        es->err_data[i] = NULL;
   77|  2.87k|        es->err_data_flags[i] = 0;
   78|       |
   79|       |        /*
   80|       |         * Try to maximize the space available.  If that fails, we use what
   81|       |         * we have.
   82|       |         */
   83|  2.87k|        if (buf_size < ERR_MAX_DATA_SIZE
  ------------------
  |  |  392|  5.75k|#define ERR_MAX_DATA_SIZE       1024
  ------------------
  |  Branch (83:13): [True: 2.86k, False: 14]
  ------------------
   84|  2.87k|            && (rbuf = OPENSSL_realloc(buf, ERR_MAX_DATA_SIZE)) != NULL) {
  ------------------
  |  |  100|  2.86k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  2.86k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  2.86k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (84:16): [True: 2.86k, False: 0]
  ------------------
   85|  2.86k|            buf = rbuf;
   86|  2.86k|            buf_size = ERR_MAX_DATA_SIZE;
  ------------------
  |  |  392|  2.86k|#define ERR_MAX_DATA_SIZE       1024
  ------------------
   87|  2.86k|        }
   88|       |
   89|  2.87k|        if (buf != NULL) {
  ------------------
  |  Branch (89:13): [True: 2.87k, False: 0]
  ------------------
   90|  2.87k|            printed_len = BIO_vsnprintf(buf, buf_size, fmt, args);
   91|  2.87k|        }
   92|  2.87k|        if (printed_len < 0)
  ------------------
  |  Branch (92:13): [True: 1.63k, False: 1.24k]
  ------------------
   93|  1.63k|            printed_len = 0;
   94|  2.87k|        if (buf != NULL)
  ------------------
  |  Branch (94:13): [True: 2.87k, False: 0]
  ------------------
   95|  2.87k|            buf[printed_len] = '\0';
   96|       |
   97|       |        /*
   98|       |         * Try to reduce the size, but only if we maximized above.  If that
   99|       |         * fails, we keep what we have.
  100|       |         * (According to documentation, realloc leaves the old buffer untouched
  101|       |         * if it fails)
  102|       |         */
  103|  2.87k|        if ((rbuf = OPENSSL_realloc(buf, printed_len + 1)) != NULL) {
  ------------------
  |  |  100|  2.87k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  2.87k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  2.87k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (103:13): [True: 2.87k, False: 0]
  ------------------
  104|  2.87k|            buf = rbuf;
  105|  2.87k|            buf_size = printed_len + 1;
  106|  2.87k|            buf[printed_len] = '\0';
  107|  2.87k|        }
  108|       |
  109|  2.87k|        if (buf != NULL)
  ------------------
  |  Branch (109:13): [True: 2.87k, False: 0]
  ------------------
  110|  2.87k|            flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|  2.87k|# define ERR_TXT_MALLOCED        0x01
  ------------------
                          flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|  2.87k|# define ERR_TXT_STRING          0x02
  ------------------
  111|  2.87k|    }
  112|       |
  113|  4.86k|    err_clear_data(es, es->top, 0);
  114|  4.86k|    err_set_error(es, es->top, lib, reason);
  115|  4.86k|    if (fmt != NULL)
  ------------------
  |  Branch (115:9): [True: 2.87k, False: 1.98k]
  ------------------
  116|  2.87k|        err_set_data(es, es->top, buf, buf_size, flags);
  117|  4.86k|}

err.c:err_clear:
   80|  50.1k|{
   81|  50.1k|    err_clear_data(es, i, (deall));
   82|  50.1k|    es->err_marks[i] = 0;
   83|  50.1k|    es->err_flags[i] = 0;
   84|  50.1k|    es->err_buffer[i] = 0;
   85|  50.1k|    es->err_line[i] = -1;
   86|  50.1k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  106|  50.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  50.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  50.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   87|  50.1k|    es->err_file[i] = NULL;
   88|  50.1k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  106|  50.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  50.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  50.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   89|  50.1k|    es->err_func[i] = NULL;
   90|  50.1k|}
err.c:err_clear_data:
   21|  51.2k|{
   22|  51.2k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  51.2k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (22:9): [True: 17.6k, False: 33.6k]
  ------------------
   23|  17.6k|        if (deall) {
  ------------------
  |  Branch (23:13): [True: 16, False: 17.6k]
  ------------------
   24|     16|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  106|     16|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   25|     16|            es->err_data[i] = NULL;
   26|     16|            es->err_data_size[i] = 0;
   27|     16|            es->err_data_flags[i] = 0;
   28|  17.6k|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (28:20): [True: 17.6k, False: 0]
  ------------------
   29|  17.6k|            es->err_data[i][0] = '\0';
   30|  17.6k|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|  17.6k|# define ERR_TXT_MALLOCED        0x01
  ------------------
   31|  17.6k|        }
   32|  33.6k|    } else {
   33|  33.6k|        es->err_data[i] = NULL;
   34|  33.6k|        es->err_data_size[i] = 0;
   35|  33.6k|        es->err_data_flags[i] = 0;
   36|  33.6k|    }
   37|  51.2k|}
err.c:err_set_data:
   71|  1.14k|{
   72|  1.14k|    if ((es->err_data_flags[i] & ERR_TXT_MALLOCED) != 0)
  ------------------
  |  |   48|  1.14k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (72:9): [True: 445, False: 703]
  ------------------
   73|    445|        OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  106|    445|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|    445|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|    445|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|  1.14k|    es->err_data[i] = data;
   75|  1.14k|    es->err_data_size[i] = datasz;
   76|  1.14k|    es->err_data_flags[i] = flags;
   77|  1.14k|}
err_blocks.c:err_get_slot:
   14|  4.86k|{
   15|  4.86k|    es->top = (es->top + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|  4.86k|#  define ERR_NUM_ERRORS  16
  ------------------
   16|  4.86k|    if (es->top == es->bottom)
  ------------------
  |  Branch (16:9): [True: 2.59k, False: 2.26k]
  ------------------
   17|  2.59k|        es->bottom = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|  2.59k|#  define ERR_NUM_ERRORS  16
  ------------------
   18|  4.86k|}
err_blocks.c:err_clear:
   80|  4.86k|{
   81|  4.86k|    err_clear_data(es, i, (deall));
   82|  4.86k|    es->err_marks[i] = 0;
   83|  4.86k|    es->err_flags[i] = 0;
   84|  4.86k|    es->err_buffer[i] = 0;
   85|  4.86k|    es->err_line[i] = -1;
   86|  4.86k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  106|  4.86k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  4.86k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  4.86k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   87|  4.86k|    es->err_file[i] = NULL;
   88|  4.86k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  106|  4.86k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  4.86k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  4.86k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   89|  4.86k|    es->err_func[i] = NULL;
   90|  4.86k|}
err_blocks.c:err_set_debug:
   51|  4.86k|{
   52|       |    /*
   53|       |     * We dup the file and fn strings because they may be provider owned. If the
   54|       |     * provider gets unloaded, they may not be valid anymore.
   55|       |     */
   56|  4.86k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  106|  4.86k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  4.86k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  4.86k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   57|  4.86k|    if (file == NULL || file[0] == '\0')
  ------------------
  |  Branch (57:9): [True: 0, False: 4.86k]
  |  Branch (57:25): [True: 0, False: 4.86k]
  ------------------
   58|      0|        es->err_file[i] = NULL;
   59|  4.86k|    else
   60|  4.86k|        es->err_file[i] = OPENSSL_strdup(file);
  ------------------
  |  |  110|  4.86k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  4.86k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  4.86k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|  4.86k|    es->err_line[i] = line;
   62|  4.86k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  106|  4.86k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  4.86k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  4.86k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   63|  4.86k|    if (fn == NULL || fn[0] == '\0')
  ------------------
  |  Branch (63:9): [True: 0, False: 4.86k]
  |  Branch (63:23): [True: 0, False: 4.86k]
  ------------------
   64|      0|        es->err_func[i] = NULL;
   65|  4.86k|    else
   66|  4.86k|        es->err_func[i] = OPENSSL_strdup(fn);
  ------------------
  |  |  110|  4.86k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  4.86k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  4.86k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|  4.86k|}
err_blocks.c:err_clear_data:
   21|  9.72k|{
   22|  9.72k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  9.72k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (22:9): [True: 6.81k, False: 2.91k]
  ------------------
   23|  6.81k|        if (deall) {
  ------------------
  |  Branch (23:13): [True: 0, False: 6.81k]
  ------------------
   24|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   25|      0|            es->err_data[i] = NULL;
   26|      0|            es->err_data_size[i] = 0;
   27|      0|            es->err_data_flags[i] = 0;
   28|  6.81k|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (28:20): [True: 6.81k, False: 0]
  ------------------
   29|  6.81k|            es->err_data[i][0] = '\0';
   30|  6.81k|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|  6.81k|# define ERR_TXT_MALLOCED        0x01
  ------------------
   31|  6.81k|        }
   32|  6.81k|    } else {
   33|  2.91k|        es->err_data[i] = NULL;
   34|  2.91k|        es->err_data_size[i] = 0;
   35|  2.91k|        es->err_data_flags[i] = 0;
   36|  2.91k|    }
   37|  9.72k|}
err_blocks.c:err_set_error:
   41|  4.86k|{
   42|  4.86k|    es->err_buffer[i] =
   43|  4.86k|        lib == ERR_LIB_SYS
  ------------------
  |  |   72|  4.86k|# define ERR_LIB_SYS             2
  ------------------
  |  Branch (43:9): [True: 2.19k, False: 2.67k]
  ------------------
   44|  4.86k|        ? (unsigned int)(ERR_SYSTEM_FLAG |  reason)
  ------------------
  |  |  218|  2.19k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  ------------------
   45|  4.86k|        : ERR_PACK(lib, 0, reason);
  ------------------
  |  |  279|  7.53k|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|  2.67k|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|  2.67k|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|  7.53k|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|  2.67k|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
   46|  4.86k|}
err_blocks.c:err_set_data:
   71|  2.87k|{
   72|  2.87k|    if ((es->err_data_flags[i] & ERR_TXT_MALLOCED) != 0)
  ------------------
  |  |   48|  2.87k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (72:9): [True: 0, False: 2.87k]
  ------------------
   73|      0|        OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|  2.87k|    es->err_data[i] = data;
   75|  2.87k|    es->err_data_size[i] = datasz;
   76|  2.87k|    es->err_data_flags[i] = flags;
   77|  2.87k|}

ossl_err_load_ESS_strings:
   42|      2|{
   43|      2|#ifndef OPENSSL_NO_ERR
   44|      2|    if (ERR_reason_error_string(ESS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (44:9): [True: 2, False: 0]
  ------------------
   45|      2|        ERR_load_strings_const(ESS_str_reasons);
   46|      2|#endif
   47|      2|    return 1;
   48|      2|}

ossl_err_load_EVP_strings:
  202|      2|{
  203|      2|#ifndef OPENSSL_NO_ERR
  204|      2|    if (ERR_reason_error_string(EVP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (204:9): [True: 2, False: 0]
  ------------------
  205|      2|        ERR_load_strings_const(EVP_str_reasons);
  206|      2|#endif
  207|      2|    return 1;
  208|      2|}

EVP_PBE_cleanup:
  284|      2|{
  285|      2|    sk_EVP_PBE_CTL_pop_free(pbe_algs, free_evp_pbe_ctl);
  286|      2|    pbe_algs = NULL;
  287|      2|}

evp_cleanup_int:
  154|      2|{
  155|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_KDF_METH);
  ------------------
  |  |   30|      2|# define OBJ_NAME_TYPE_KDF_METH          0x06
  ------------------
  156|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  157|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  158|       |    /*
  159|       |     * The above calls will only clean out the contents of the name hash
  160|       |     * table, but not the hash table itself.  The following line does that
  161|       |     * part.  -- Richard Levitte
  162|       |     */
  163|      2|    OBJ_NAME_cleanup(-1);
  164|       |
  165|      2|    EVP_PBE_cleanup();
  166|      2|    OBJ_sigid_free();
  167|       |
  168|      2|    evp_app_cleanup_int();
  169|      2|}

evp_app_cleanup_int:
  644|      2|{
  645|      2|    if (app_pkey_methods != NULL)
  ------------------
  |  Branch (645:9): [True: 0, False: 2]
  ------------------
  646|      0|        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
  647|      2|}

ossl_do_ex_data_init:
   15|      2|{
   16|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   17|       |
   18|      2|    if (global == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 2]
  ------------------
   19|      0|        return 0;
   20|       |
   21|      2|    global->ex_data_lock = CRYPTO_THREAD_lock_new();
   22|      2|    return global->ex_data_lock != NULL;
   23|      2|}
ossl_crypto_cleanup_all_ex_data_int:
   65|      2|{
   66|      2|    int i;
   67|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   68|       |
   69|      2|    if (global == NULL)
  ------------------
  |  Branch (69:9): [True: 0, False: 2]
  ------------------
   70|      0|        return;
   71|       |
   72|     38|    for (i = 0; i < CRYPTO_EX_INDEX__COUNT; ++i) {
  ------------------
  |  |  236|     38|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (72:17): [True: 36, False: 2]
  ------------------
   73|     36|        EX_CALLBACKS *ip = &global->ex_data[i];
   74|       |
   75|     36|        sk_EX_CALLBACK_pop_free(ip->meth, cleanup_cb);
   76|     36|        ip->meth = NULL;
   77|     36|    }
   78|       |
   79|      2|    CRYPTO_THREAD_lock_free(global->ex_data_lock);
   80|      2|    global->ex_data_lock = NULL;
   81|      2|}
ossl_crypto_get_ex_new_index_ex:
  147|      2|{
  148|      2|    int toret = -1;
  149|      2|    EX_CALLBACK *a;
  150|      2|    EX_CALLBACKS *ip;
  151|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  152|       |
  153|      2|    if (global == NULL)
  ------------------
  |  Branch (153:9): [True: 0, False: 2]
  ------------------
  154|      0|        return -1;
  155|       |
  156|      2|    ip = get_and_lock(global, class_index);
  157|      2|    if (ip == NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 2]
  ------------------
  158|      0|        return -1;
  159|       |
  160|      2|    if (ip->meth == NULL) {
  ------------------
  |  Branch (160:9): [True: 2, False: 0]
  ------------------
  161|      2|        ip->meth = sk_EX_CALLBACK_new_null();
  162|       |        /* We push an initial value on the stack because the SSL
  163|       |         * "app_data" routines use ex_data index zero.  See RT 3710. */
  164|      2|        if (ip->meth == NULL
  ------------------
  |  Branch (164:13): [True: 0, False: 2]
  ------------------
  165|      2|            || !sk_EX_CALLBACK_push(ip->meth, NULL)) {
  ------------------
  |  Branch (165:16): [True: 0, False: 2]
  ------------------
  166|      0|            sk_EX_CALLBACK_free(ip->meth);
  167|      0|            ip->meth = NULL;
  168|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  169|      0|            goto err;
  170|      0|        }
  171|      2|    }
  172|       |
  173|      2|    a = (EX_CALLBACK *)OPENSSL_malloc(sizeof(*a));
  ------------------
  |  |   96|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  174|      2|    if (a == NULL) {
  ------------------
  |  Branch (174:9): [True: 0, False: 2]
  ------------------
  175|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  176|      0|        goto err;
  177|      0|    }
  178|      2|    a->argl = argl;
  179|      2|    a->argp = argp;
  180|      2|    a->new_func = new_func;
  181|      2|    a->dup_func = dup_func;
  182|      2|    a->free_func = free_func;
  183|      2|    a->priority = priority;
  184|       |
  185|      2|    if (!sk_EX_CALLBACK_push(ip->meth, NULL)) {
  ------------------
  |  Branch (185:9): [True: 0, False: 2]
  ------------------
  186|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  187|      0|        OPENSSL_free(a);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  188|      0|        goto err;
  189|      0|    }
  190|      2|    toret = sk_EX_CALLBACK_num(ip->meth) - 1;
  191|      2|    (void)sk_EX_CALLBACK_set(ip->meth, toret, a);
  192|       |
  193|      2| err:
  194|      2|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  195|      2|    return toret;
  196|      2|}
ossl_crypto_new_ex_data_ex:
  215|  3.39k|{
  216|  3.39k|    int mx, i;
  217|  3.39k|    void *ptr;
  218|  3.39k|    EX_CALLBACK **storage = NULL;
  219|  3.39k|    EX_CALLBACK *stack[10];
  220|  3.39k|    EX_CALLBACKS *ip;
  221|  3.39k|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  222|       |
  223|  3.39k|    if (global == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 3.39k]
  ------------------
  224|      0|        return 0;
  225|       |
  226|  3.39k|    ip = get_and_lock(global, class_index);
  227|  3.39k|    if (ip == NULL)
  ------------------
  |  Branch (227:9): [True: 0, False: 3.39k]
  ------------------
  228|      0|        return 0;
  229|       |
  230|  3.39k|    ad->ctx = ctx;
  231|  3.39k|    ad->sk = NULL;
  232|  3.39k|    mx = sk_EX_CALLBACK_num(ip->meth);
  233|  3.39k|    if (mx > 0) {
  ------------------
  |  Branch (233:9): [True: 0, False: 3.39k]
  ------------------
  234|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (234:13): [True: 0, False: 0]
  ------------------
  235|      0|            storage = stack;
  236|      0|        else
  237|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |   96|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  238|      0|        if (storage != NULL)
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  ------------------
  239|      0|            for (i = 0; i < mx; i++)
  ------------------
  |  Branch (239:25): [True: 0, False: 0]
  ------------------
  240|      0|                storage[i] = sk_EX_CALLBACK_value(ip->meth, i);
  241|      0|    }
  242|  3.39k|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  243|       |
  244|  3.39k|    if (mx > 0 && storage == NULL) {
  ------------------
  |  Branch (244:9): [True: 0, False: 3.39k]
  |  Branch (244:19): [True: 0, False: 0]
  ------------------
  245|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  246|      0|        return 0;
  247|      0|    }
  248|  3.39k|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (248:17): [True: 0, False: 3.39k]
  ------------------
  249|      0|        if (storage[i] != NULL && storage[i]->new_func != NULL) {
  ------------------
  |  Branch (249:13): [True: 0, False: 0]
  |  Branch (249:35): [True: 0, False: 0]
  ------------------
  250|      0|            ptr = CRYPTO_get_ex_data(ad, i);
  251|      0|            storage[i]->new_func(obj, ptr, ad, i,
  252|      0|                                 storage[i]->argl, storage[i]->argp);
  253|      0|        }
  254|      0|    }
  255|  3.39k|    if (storage != stack)
  ------------------
  |  Branch (255:9): [True: 3.39k, False: 0]
  ------------------
  256|  3.39k|        OPENSSL_free(storage);
  ------------------
  |  |  106|  3.39k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.39k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.39k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  257|  3.39k|    return 1;
  258|  3.39k|}
CRYPTO_new_ex_data:
  261|  3.38k|{
  262|  3.38k|    return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
  263|  3.38k|}
CRYPTO_free_ex_data:
  366|  3.39k|{
  367|  3.39k|    int mx, i;
  368|  3.39k|    EX_CALLBACKS *ip;
  369|  3.39k|    void *ptr;
  370|  3.39k|    const EX_CALLBACK *f;
  371|  3.39k|    struct ex_callback_entry stack[10];
  372|  3.39k|    struct ex_callback_entry *storage = NULL;
  373|  3.39k|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  374|       |
  375|  3.39k|    if (global == NULL)
  ------------------
  |  Branch (375:9): [True: 0, False: 3.39k]
  ------------------
  376|      0|        goto err;
  377|       |
  378|  3.39k|    ip = get_and_lock(global, class_index);
  379|  3.39k|    if (ip == NULL)
  ------------------
  |  Branch (379:9): [True: 0, False: 3.39k]
  ------------------
  380|      0|        goto err;
  381|       |
  382|  3.39k|    mx = sk_EX_CALLBACK_num(ip->meth);
  383|  3.39k|    if (mx > 0) {
  ------------------
  |  Branch (383:9): [True: 2, False: 3.38k]
  ------------------
  384|      2|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|      2|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (384:13): [True: 2, False: 0]
  ------------------
  385|      2|            storage = stack;
  386|      0|        else
  387|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |   96|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  388|      2|        if (storage != NULL)
  ------------------
  |  Branch (388:13): [True: 2, False: 0]
  ------------------
  389|      6|            for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (389:25): [True: 4, False: 2]
  ------------------
  390|      4|                storage[i].excb = sk_EX_CALLBACK_value(ip->meth, i);
  391|      4|                storage[i].index = i;
  392|      4|            }
  393|      2|    }
  394|  3.39k|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  395|       |
  396|  3.39k|    if (storage != NULL) {
  ------------------
  |  Branch (396:9): [True: 2, False: 3.38k]
  ------------------
  397|       |        /* Sort according to priority. High priority first */
  398|      2|        qsort(storage, mx, sizeof(*storage), ex_callback_compare);
  399|      6|        for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (399:21): [True: 4, False: 2]
  ------------------
  400|      4|            f = storage[i].excb;
  401|       |
  402|      4|            if (f != NULL && f->free_func != NULL) {
  ------------------
  |  Branch (402:17): [True: 2, False: 2]
  |  Branch (402:30): [True: 2, False: 0]
  ------------------
  403|      2|                ptr = CRYPTO_get_ex_data(ad, storage[i].index);
  404|      2|                f->free_func(obj, ptr, ad, storage[i].index, f->argl, f->argp);
  405|      2|            }
  406|      4|        }
  407|      2|    }
  408|       |
  409|  3.39k|    if (storage != stack)
  ------------------
  |  Branch (409:9): [True: 3.38k, False: 2]
  ------------------
  410|  3.38k|        OPENSSL_free(storage);
  ------------------
  |  |  106|  3.38k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.38k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.38k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  411|  3.39k| err:
  412|  3.39k|    sk_void_free(ad->sk);
  ------------------
  |  |  192|  3.39k|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
  413|  3.39k|    ad->sk = NULL;
  414|  3.39k|    ad->ctx = NULL;
  415|  3.39k|}
ossl_crypto_alloc_ex_data_intern:
  436|      2|{
  437|      2|    EX_CALLBACK *f;
  438|      2|    EX_CALLBACKS *ip;
  439|      2|    OSSL_EX_DATA_GLOBAL *global;
  440|       |
  441|      2|    global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  442|      2|    if (global == NULL)
  ------------------
  |  Branch (442:9): [True: 0, False: 2]
  ------------------
  443|      0|        return 0;
  444|       |
  445|      2|    ip = get_and_lock(global, class_index);
  446|      2|    if (ip == NULL)
  ------------------
  |  Branch (446:9): [True: 0, False: 2]
  ------------------
  447|      0|        return 0;
  448|      2|    f = sk_EX_CALLBACK_value(ip->meth, idx);
  449|      2|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  450|       |
  451|       |    /*
  452|       |     * This should end up calling CRYPTO_set_ex_data(), which allocates
  453|       |     * everything necessary to support placing the new data in the right spot.
  454|       |     */
  455|      2|    if (f->new_func == NULL)
  ------------------
  |  Branch (455:9): [True: 0, False: 2]
  ------------------
  456|      0|        return 0;
  457|       |
  458|      2|    f->new_func(obj, NULL, ad, idx, f->argl, f->argp);
  459|       |
  460|      2|    return 1;
  461|      2|}
CRYPTO_set_ex_data:
  468|      2|{
  469|      2|    int i;
  470|       |
  471|      2|    if (ad->sk == NULL) {
  ------------------
  |  Branch (471:9): [True: 2, False: 0]
  ------------------
  472|      2|        if ((ad->sk = sk_void_new_null()) == NULL) {
  ------------------
  |  |  189|      2|#define sk_void_new_null() ((STACK_OF(void) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (472:13): [True: 0, False: 2]
  ------------------
  473|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  474|      0|            return 0;
  475|      0|        }
  476|      2|    }
  477|       |
  478|      6|    for (i = sk_void_num(ad->sk); i <= idx; ++i) {
  ------------------
  |  |  186|      2|#define sk_void_num(sk) OPENSSL_sk_num(ossl_check_const_void_sk_type(sk))
  ------------------
  |  Branch (478:35): [True: 4, False: 2]
  ------------------
  479|      4|        if (!sk_void_push(ad->sk, NULL)) {
  ------------------
  |  |  196|      4|#define sk_void_push(sk, ptr) OPENSSL_sk_push(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
  ------------------
  |  Branch (479:13): [True: 0, False: 4]
  ------------------
  480|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  481|      0|            return 0;
  482|      0|        }
  483|      4|    }
  484|      2|    if (sk_void_set(ad->sk, idx, val) != val) {
  ------------------
  |  |  202|      2|#define sk_void_set(sk, idx, ptr) ((void *)OPENSSL_sk_set(ossl_check_void_sk_type(sk), (idx), ossl_check_void_type(ptr)))
  ------------------
  |  Branch (484:9): [True: 0, False: 2]
  ------------------
  485|       |        /* Probably the index is out of bounds */
  486|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  487|      0|        return 0;
  488|      0|    }
  489|      2|    return 1;
  490|      2|}
CRYPTO_get_ex_data:
  497|     18|{
  498|     18|    if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
  ------------------
  |  |  186|     18|#define sk_void_num(sk) OPENSSL_sk_num(ossl_check_const_void_sk_type(sk))
  ------------------
  |  Branch (498:9): [True: 0, False: 18]
  |  Branch (498:27): [True: 0, False: 18]
  ------------------
  499|      0|        return NULL;
  500|     18|    return sk_void_value(ad->sk, idx);
  ------------------
  |  |  187|     18|#define sk_void_value(sk, idx) ((void *)OPENSSL_sk_value(ossl_check_const_void_sk_type(sk), (idx)))
  ------------------
  501|     18|}
ossl_crypto_ex_data_get_ossl_lib_ctx:
  504|      2|{
  505|      2|    return ad->ctx;
  506|      2|}
ex_data.c:cleanup_cb:
   54|      2|{
   55|      2|    OPENSSL_free(funcs);
  ------------------
  |  |  106|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      2|}
ex_data.c:get_and_lock:
   31|  6.78k|{
   32|  6.78k|    EX_CALLBACKS *ip;
   33|       |
   34|  6.78k|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  236|  6.78k|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (34:9): [True: 0, False: 6.78k]
  |  Branch (34:28): [True: 0, False: 6.78k]
  ------------------
   35|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   36|      0|        return NULL;
   37|      0|    }
   38|       |
   39|  6.78k|    if (global->ex_data_lock == NULL) {
  ------------------
  |  Branch (39:9): [True: 0, False: 6.78k]
  ------------------
   40|       |        /*
   41|       |         * If we get here, someone (who?) cleaned up the lock, so just
   42|       |         * treat it as an error.
   43|       |         */
   44|      0|         return NULL;
   45|      0|    }
   46|       |
   47|  6.78k|    if (!CRYPTO_THREAD_write_lock(global->ex_data_lock))
  ------------------
  |  Branch (47:9): [True: 0, False: 6.78k]
  ------------------
   48|      0|        return NULL;
   49|  6.78k|    ip = &global->ex_data[class_index];
   50|  6.78k|    return ip;
   51|  6.78k|}
ex_data.c:ex_callback_compare:
  345|      2|{
  346|      2|    const struct ex_callback_entry *ap = (const struct ex_callback_entry *)a;
  347|      2|    const struct ex_callback_entry *bp = (const struct ex_callback_entry *)b;
  348|       |
  349|      2|    if (ap->excb == bp->excb)
  ------------------
  |  Branch (349:9): [True: 0, False: 2]
  ------------------
  350|      0|        return 0;
  351|       |
  352|      2|    if (ap->excb == NULL)
  ------------------
  |  Branch (352:9): [True: 2, False: 0]
  ------------------
  353|      2|        return 1;
  354|      0|    if (bp->excb == NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 0]
  ------------------
  355|      0|        return -1;
  356|      0|    if (ap->excb->priority == bp->excb->priority)
  ------------------
  |  Branch (356:9): [True: 0, False: 0]
  ------------------
  357|      0|        return 0;
  358|      0|    return ap->excb->priority > bp->excb->priority ? -1 : 1;
  ------------------
  |  Branch (358:12): [True: 0, False: 0]
  ------------------
  359|      0|}

ossl_safe_getenv:
   19|  1.97k|{
   20|       |#if defined(_WIN32) && defined(CP_UTF8) && !defined(_WIN32_WCE)
   21|       |    if (GetEnvironmentVariableW(L"OPENSSL_WIN32_UTF8", NULL, 0) != 0) {
   22|       |        char *val = NULL;
   23|       |        int vallen = 0;
   24|       |        WCHAR *namew = NULL;
   25|       |        WCHAR *valw = NULL;
   26|       |        DWORD envlen = 0;
   27|       |        DWORD dwFlags = MB_ERR_INVALID_CHARS;
   28|       |        int rsize, fsize;
   29|       |        UINT curacp;
   30|       |
   31|       |        curacp = GetACP();
   32|       |
   33|       |        /*
   34|       |         * For the code pages listed below, dwFlags must be set to 0.
   35|       |         * Otherwise, the function fails with ERROR_INVALID_FLAGS.
   36|       |         */
   37|       |        if (curacp == 50220 || curacp == 50221 || curacp == 50222 ||
   38|       |            curacp == 50225 || curacp == 50227 || curacp == 50229 ||
   39|       |            (57002 <= curacp && curacp <=57011) || curacp == 65000 ||
   40|       |            curacp == 42)
   41|       |            dwFlags = 0;
   42|       |
   43|       |        /* query for buffer len */
   44|       |        rsize = MultiByteToWideChar(curacp, dwFlags, name, -1, NULL, 0);
   45|       |        /* if name is valid string and can be converted to wide string */
   46|       |        if (rsize > 0)
   47|       |            namew = _malloca(rsize * sizeof(WCHAR));
   48|       |
   49|       |        if (NULL != namew) {
   50|       |            /* convert name to wide string */
   51|       |            fsize = MultiByteToWideChar(curacp, dwFlags, name, -1, namew, rsize);
   52|       |            /* if conversion is ok, then determine value string size in wchars */
   53|       |            if (fsize > 0)
   54|       |                envlen = GetEnvironmentVariableW(namew, NULL, 0);
   55|       |        }
   56|       |
   57|       |        if (envlen > 0)
   58|       |            valw = _malloca(envlen * sizeof(WCHAR));
   59|       |
   60|       |        if (NULL != valw) {
   61|       |            /* if can get env value as wide string */
   62|       |            if (GetEnvironmentVariableW(namew, valw, envlen) < envlen) {
   63|       |                /* determine value string size in utf-8 */
   64|       |                vallen = WideCharToMultiByte(CP_UTF8, 0, valw, -1, NULL, 0,
   65|       |                                             NULL, NULL);
   66|       |            }
   67|       |        }
   68|       |
   69|       |        if (vallen > 0)
   70|       |            val = OPENSSL_malloc(vallen);
   71|       |
   72|       |        if (NULL != val) {
   73|       |            /* convert value string from wide to utf-8 */
   74|       |            if (WideCharToMultiByte(CP_UTF8, 0, valw, -1, val, vallen,
   75|       |                                    NULL, NULL) == 0) {
   76|       |                OPENSSL_free(val);
   77|       |                val = NULL;
   78|       |            }
   79|       |        }
   80|       |
   81|       |        if (NULL != namew)
   82|       |            _freea(namew);
   83|       |
   84|       |        if (NULL != valw)
   85|       |            _freea(valw);
   86|       |
   87|       |        return val;
   88|       |    }
   89|       |#endif
   90|       |
   91|  1.97k|#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
   92|  1.97k|# if __GLIBC_PREREQ(2, 17)
   93|  1.97k|#  define SECURE_GETENV
   94|  1.97k|    return secure_getenv(name);
   95|  1.97k|# endif
   96|  1.97k|#endif
   97|       |
   98|       |#ifndef SECURE_GETENV
   99|       |    if (OPENSSL_issetugid())
  100|       |        return NULL;
  101|       |    return getenv(name);
  102|       |#endif
  103|  1.97k|}

ossl_err_load_HTTP_strings:
   76|      2|{
   77|      2|#ifndef OPENSSL_NO_ERR
   78|      2|    if (ERR_reason_error_string(HTTP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (78:9): [True: 2, False: 0]
  ------------------
   79|      2|        ERR_load_strings_const(HTTP_str_reasons);
   80|      2|#endif
   81|      2|    return 1;
   82|      2|}

OPENSSL_cleanup:
  345|      2|{
  346|      2|    OPENSSL_INIT_STOP *currhandler, *lasthandler;
  347|       |
  348|       |    /*
  349|       |     * At some point we should consider looking at this function with a view to
  350|       |     * moving most/all of this into onfree handlers in OSSL_LIB_CTX.
  351|       |     */
  352|       |
  353|       |    /* If we've not been inited then no need to deinit */
  354|      2|    if (!base_inited)
  ------------------
  |  Branch (354:9): [True: 0, False: 2]
  ------------------
  355|      0|        return;
  356|       |
  357|       |    /* Might be explicitly called and also by atexit */
  358|      2|    if (stopped)
  ------------------
  |  Branch (358:9): [True: 0, False: 2]
  ------------------
  359|      0|        return;
  360|      2|    stopped = 1;
  361|       |
  362|       |    /*
  363|       |     * Thread stop may not get automatically called by the thread library for
  364|       |     * the very last thread in some situations, so call it directly.
  365|       |     */
  366|      2|    OPENSSL_thread_stop();
  367|       |
  368|      2|    currhandler = stop_handlers;
  369|      2|    while (currhandler != NULL) {
  ------------------
  |  Branch (369:12): [True: 0, False: 2]
  ------------------
  370|      0|        currhandler->handler();
  371|      0|        lasthandler = currhandler;
  372|      0|        currhandler = currhandler->next;
  373|      0|        OPENSSL_free(lasthandler);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  374|      0|    }
  375|      2|    stop_handlers = NULL;
  376|       |
  377|      2|    CRYPTO_THREAD_lock_free(optsdone_lock);
  378|      2|    optsdone_lock = NULL;
  379|      2|    CRYPTO_THREAD_lock_free(init_lock);
  380|      2|    init_lock = NULL;
  381|       |
  382|      2|    CRYPTO_THREAD_cleanup_local(&in_init_config_local);
  383|       |
  384|       |    /*
  385|       |     * We assume we are single-threaded for this function, i.e. no race
  386|       |     * conditions for the various "*_inited" vars below.
  387|       |     */
  388|       |
  389|      2|#ifndef OPENSSL_NO_COMP
  390|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zlib_cleanup()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  391|      2|    ossl_comp_zlib_cleanup();
  392|      2|#endif
  393|       |
  394|      2|    if (async_inited) {
  ------------------
  |  Branch (394:9): [True: 0, False: 2]
  ------------------
  395|      0|        OSSL_TRACE(INIT, "OPENSSL_cleanup: async_deinit()\n");
  ------------------
  |  |  285|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  396|      0|        async_deinit();
  397|      0|    }
  398|       |
  399|       |    /*
  400|       |     * Note that cleanup order is important:
  401|       |     * - ossl_rand_cleanup_int could call an ENGINE's RAND cleanup function so
  402|       |     * must be called before engine_cleanup_int()
  403|       |     * - ENGINEs use CRYPTO_EX_DATA and therefore, must be cleaned up
  404|       |     * before the ex data handlers are wiped during default ossl_lib_ctx deinit.
  405|       |     * - ossl_config_modules_free() can end up in ENGINE code so must be called
  406|       |     * before engine_cleanup_int()
  407|       |     * - ENGINEs and additional EVP algorithms might use added OIDs names so
  408|       |     * ossl_obj_cleanup_int() must be called last
  409|       |     */
  410|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_rand_cleanup_int()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  411|      2|    ossl_rand_cleanup_int();
  412|       |
  413|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_config_modules_free()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  414|      2|    ossl_config_modules_free();
  415|       |
  416|      2|#ifndef OPENSSL_NO_ENGINE
  417|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: engine_cleanup_int()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  418|      2|    engine_cleanup_int();
  419|      2|#endif
  420|       |
  421|      2|#ifndef OPENSSL_NO_DEPRECATED_3_0
  422|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_store_cleanup_int()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  423|      2|    ossl_store_cleanup_int();
  424|      2|#endif
  425|       |
  426|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_lib_ctx_default_deinit()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  427|      2|    ossl_lib_ctx_default_deinit();
  428|       |
  429|      2|    ossl_cleanup_thread();
  430|       |
  431|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: bio_cleanup()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  432|      2|    bio_cleanup();
  433|       |
  434|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: evp_cleanup_int()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  435|      2|    evp_cleanup_int();
  436|       |
  437|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_obj_cleanup_int()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  438|      2|    ossl_obj_cleanup_int();
  439|       |
  440|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: err_int()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  441|      2|    err_cleanup();
  442|       |
  443|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: CRYPTO_secure_malloc_done()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  444|      2|    CRYPTO_secure_malloc_done();
  445|       |
  446|      2|#ifndef OPENSSL_NO_CMP
  447|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: OSSL_CMP_log_close()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  448|      2|    OSSL_CMP_log_close();
  449|      2|#endif
  450|       |
  451|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_trace_cleanup()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  452|      2|    ossl_trace_cleanup();
  453|       |
  454|      2|    base_inited = 0;
  455|      2|}
OPENSSL_init_crypto:
  463|  20.0k|{
  464|  20.0k|    uint64_t tmp;
  465|  20.0k|    int aloaddone = 0;
  466|       |
  467|       |   /* Applications depend on 0 being returned when cleanup was already done */
  468|  20.0k|    if (stopped) {
  ------------------
  |  Branch (468:9): [True: 0, False: 20.0k]
  ------------------
  469|      0|        if (!(opts & OPENSSL_INIT_BASE_ONLY))
  ------------------
  |  |   31|      0|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (469:13): [True: 0, False: 0]
  ------------------
  470|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  471|      0|        return 0;
  472|      0|    }
  473|       |
  474|       |    /*
  475|       |     * We ignore failures from this function. It is probably because we are
  476|       |     * on a platform that doesn't support lockless atomic loads (we may not
  477|       |     * have created optsdone_lock yet so we can't use it). This is just an
  478|       |     * optimisation to skip the full checks in this function if we don't need
  479|       |     * to, so we carry on regardless in the event of failure.
  480|       |     *
  481|       |     * There could be a race here with other threads, so that optsdone has not
  482|       |     * been updated yet, even though the options have in fact been initialised.
  483|       |     * This doesn't matter - it just means we will run the full function
  484|       |     * unnecessarily - but all the critical code is contained in RUN_ONCE
  485|       |     * functions anyway so we are safe.
  486|       |     */
  487|  20.0k|    if (CRYPTO_atomic_load(&optsdone, &tmp, NULL)) {
  ------------------
  |  Branch (487:9): [True: 20.0k, False: 0]
  ------------------
  488|  20.0k|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (488:13): [True: 2, False: 20.0k]
  ------------------
  489|      2|            return 1;
  490|  20.0k|        aloaddone = 1;
  491|  20.0k|    }
  492|       |
  493|       |    /*
  494|       |     * At some point we should look at this function with a view to moving
  495|       |     * most/all of this into OSSL_LIB_CTX.
  496|       |     *
  497|       |     * When the caller specifies OPENSSL_INIT_BASE_ONLY, that should be the
  498|       |     * *only* option specified.  With that option we return immediately after
  499|       |     * doing the requested limited initialization.  Note that
  500|       |     * err_shelve_state() called by us via ossl_init_load_crypto_nodelete()
  501|       |     * re-enters OPENSSL_init_crypto() with OPENSSL_INIT_BASE_ONLY, but with
  502|       |     * base already initialized this is a harmless NOOP.
  503|       |     *
  504|       |     * If we remain the only caller of err_shelve_state() the recursion should
  505|       |     * perhaps be removed, but if in doubt, it can be left in place.
  506|       |     */
  507|  20.0k|    if (!RUN_ONCE(&base, ossl_init_base))
  ------------------
  |  |  130|  20.0k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 20.0k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (507:9): [True: 0, False: 20.0k]
  ------------------
  508|      0|        return 0;
  509|       |
  510|  20.0k|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   31|  20.0k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (510:9): [True: 20.0k, False: 2]
  ------------------
  511|  20.0k|        return 1;
  512|       |
  513|       |    /*
  514|       |     * optsdone_lock should definitely be set up now, so we can now repeat the
  515|       |     * same check from above but be sure that it will work even on platforms
  516|       |     * without lockless CRYPTO_atomic_load
  517|       |     */
  518|      2|    if (!aloaddone) {
  ------------------
  |  Branch (518:9): [True: 0, False: 2]
  ------------------
  519|      0|        if (!CRYPTO_atomic_load(&optsdone, &tmp, optsdone_lock))
  ------------------
  |  Branch (519:13): [True: 0, False: 0]
  ------------------
  520|      0|            return 0;
  521|      0|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (521:13): [True: 0, False: 0]
  ------------------
  522|      0|            return 1;
  523|      0|    }
  524|       |
  525|       |    /*
  526|       |     * Now we don't always set up exit handlers, the INIT_BASE_ONLY calls
  527|       |     * should not have the side-effect of setting up exit handlers, and
  528|       |     * therefore, this code block is below the INIT_BASE_ONLY-conditioned early
  529|       |     * return above.
  530|       |     */
  531|      2|    if ((opts & OPENSSL_INIT_NO_ATEXIT) != 0) {
  ------------------
  |  |  467|      2|# define OPENSSL_INIT_NO_ATEXIT              0x00080000L
  ------------------
  |  Branch (531:9): [True: 0, False: 2]
  ------------------
  532|      0|        if (!RUN_ONCE_ALT(&register_atexit, ossl_init_no_register_atexit,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (532:13): [True: 0, False: 0]
  ------------------
  533|      0|                          ossl_init_register_atexit))
  534|      0|            return 0;
  535|      2|    } else if (!RUN_ONCE(&register_atexit, ossl_init_register_atexit)) {
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (535:16): [True: 0, False: 2]
  ------------------
  536|      0|        return 0;
  537|      0|    }
  538|       |
  539|      2|    if (!RUN_ONCE(&load_crypto_nodelete, ossl_init_load_crypto_nodelete))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (539:9): [True: 0, False: 2]
  ------------------
  540|      0|        return 0;
  541|       |
  542|      2|    if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  448|      2|# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
  ------------------
  |  Branch (542:9): [True: 0, False: 2]
  ------------------
  543|      2|            && !RUN_ONCE_ALT(&load_crypto_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (543:16): [True: 0, False: 0]
  ------------------
  544|      2|                             ossl_init_no_load_crypto_strings,
  545|      2|                             ossl_init_load_crypto_strings))
  546|      0|        return 0;
  547|       |
  548|      2|    if ((opts & OPENSSL_INIT_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  449|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  |  Branch (548:9): [True: 2, False: 0]
  ------------------
  549|      2|            && !RUN_ONCE(&load_crypto_strings, ossl_init_load_crypto_strings))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (549:16): [True: 0, False: 2]
  ------------------
  550|      0|        return 0;
  551|       |
  552|      2|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_CIPHERS)
  ------------------
  |  |  452|      2|# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS     0x00000010L
  ------------------
  |  Branch (552:9): [True: 0, False: 2]
  ------------------
  553|      2|            && !RUN_ONCE_ALT(&add_all_ciphers, ossl_init_no_add_all_ciphers,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (553:16): [True: 0, False: 0]
  ------------------
  554|      2|                             ossl_init_add_all_ciphers))
  555|      0|        return 0;
  556|       |
  557|      2|    if ((opts & OPENSSL_INIT_ADD_ALL_CIPHERS)
  ------------------
  |  |  450|      2|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  |  Branch (557:9): [True: 0, False: 2]
  ------------------
  558|      2|            && !RUN_ONCE(&add_all_ciphers, ossl_init_add_all_ciphers))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (558:16): [True: 0, False: 0]
  ------------------
  559|      0|        return 0;
  560|       |
  561|      2|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_DIGESTS)
  ------------------
  |  |  453|      2|# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS     0x00000020L
  ------------------
  |  Branch (561:9): [True: 0, False: 2]
  ------------------
  562|      2|            && !RUN_ONCE_ALT(&add_all_digests, ossl_init_no_add_all_digests,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (562:16): [True: 0, False: 0]
  ------------------
  563|      2|                             ossl_init_add_all_digests))
  564|      0|        return 0;
  565|       |
  566|      2|    if ((opts & OPENSSL_INIT_ADD_ALL_DIGESTS)
  ------------------
  |  |  451|      2|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  |  Branch (566:9): [True: 0, False: 2]
  ------------------
  567|      2|            && !RUN_ONCE(&add_all_digests, ossl_init_add_all_digests))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (567:16): [True: 0, False: 0]
  ------------------
  568|      0|        return 0;
  569|       |
  570|      2|    if ((opts & OPENSSL_INIT_ATFORK)
  ------------------
  |  |  465|      2|# define OPENSSL_INIT_ATFORK                 0x00020000L
  ------------------
  |  Branch (570:9): [True: 0, False: 2]
  ------------------
  571|      2|            && !openssl_init_fork_handlers())
  ------------------
  |  Branch (571:16): [True: 0, False: 0]
  ------------------
  572|      0|        return 0;
  573|       |
  574|      2|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG)
  ------------------
  |  |  455|      2|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (574:9): [True: 0, False: 2]
  ------------------
  575|      2|            && !RUN_ONCE_ALT(&config, ossl_init_no_config, ossl_init_config))
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (575:16): [True: 0, False: 0]
  ------------------
  576|      0|        return 0;
  577|       |
  578|      2|    if (opts & OPENSSL_INIT_LOAD_CONFIG) {
  ------------------
  |  |  454|      2|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (578:9): [True: 0, False: 2]
  ------------------
  579|      0|        int loading = CRYPTO_THREAD_get_local(&in_init_config_local) != NULL;
  580|       |
  581|       |        /* If called recursively from OBJ_ calls, just skip it. */
  582|      0|        if (!loading) {
  ------------------
  |  Branch (582:13): [True: 0, False: 0]
  ------------------
  583|      0|            int ret;
  584|       |
  585|      0|            if (!CRYPTO_THREAD_set_local(&in_init_config_local, (void *)-1))
  ------------------
  |  Branch (585:17): [True: 0, False: 0]
  ------------------
  586|      0|                return 0;
  587|      0|            if (settings == NULL) {
  ------------------
  |  Branch (587:17): [True: 0, False: 0]
  ------------------
  588|      0|                ret = RUN_ONCE(&config, ossl_init_config);
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  589|      0|            } else {
  590|      0|                if (!CRYPTO_THREAD_write_lock(init_lock))
  ------------------
  |  Branch (590:21): [True: 0, False: 0]
  ------------------
  591|      0|                    return 0;
  592|      0|                conf_settings = settings;
  593|      0|                ret = RUN_ONCE_ALT(&config, ossl_init_config_settings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  594|      0|                                   ossl_init_config);
  595|      0|                conf_settings = NULL;
  596|      0|                CRYPTO_THREAD_unlock(init_lock);
  597|      0|            }
  598|       |
  599|      0|            if (ret <= 0)
  ------------------
  |  Branch (599:17): [True: 0, False: 0]
  ------------------
  600|      0|                return 0;
  601|      0|        }
  602|      0|    }
  603|       |
  604|      2|    if ((opts & OPENSSL_INIT_ASYNC)
  ------------------
  |  |  456|      2|# define OPENSSL_INIT_ASYNC                  0x00000100L
  ------------------
  |  Branch (604:9): [True: 0, False: 2]
  ------------------
  605|      2|            && !RUN_ONCE(&async, ossl_init_async))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (605:16): [True: 0, False: 0]
  ------------------
  606|      0|        return 0;
  607|       |
  608|      2|#ifndef OPENSSL_NO_ENGINE
  609|      2|    if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
  ------------------
  |  |  459|      2|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  |  Branch (609:9): [True: 0, False: 2]
  ------------------
  610|      2|            && !RUN_ONCE(&engine_openssl, ossl_init_engine_openssl))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (610:16): [True: 0, False: 0]
  ------------------
  611|      0|        return 0;
  612|      2|# ifndef OPENSSL_NO_RDRAND
  613|      2|    if ((opts & OPENSSL_INIT_ENGINE_RDRAND)
  ------------------
  |  |  457|      2|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  ------------------
  |  Branch (613:9): [True: 0, False: 2]
  ------------------
  614|      2|            && !RUN_ONCE(&engine_rdrand, ossl_init_engine_rdrand))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (614:16): [True: 0, False: 0]
  ------------------
  615|      0|        return 0;
  616|      2|# endif
  617|      2|    if ((opts & OPENSSL_INIT_ENGINE_DYNAMIC)
  ------------------
  |  |  458|      2|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  ------------------
  |  Branch (617:9): [True: 0, False: 2]
  ------------------
  618|      2|            && !RUN_ONCE(&engine_dynamic, ossl_init_engine_dynamic))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:16): [True: 0, False: 0]
  ------------------
  619|      0|        return 0;
  620|      2|# ifndef OPENSSL_NO_STATIC_ENGINE
  621|       |#  ifndef OPENSSL_NO_DEVCRYPTOENG
  622|       |    if ((opts & OPENSSL_INIT_ENGINE_CRYPTODEV)
  623|       |            && !RUN_ONCE(&engine_devcrypto, ossl_init_engine_devcrypto))
  624|       |        return 0;
  625|       |#  endif
  626|      2|#  if !defined(OPENSSL_NO_PADLOCKENG)
  627|      2|    if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
  ------------------
  |  |  462|      2|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  ------------------
  |  Branch (627:9): [True: 0, False: 2]
  ------------------
  628|      2|            && !RUN_ONCE(&engine_padlock, ossl_init_engine_padlock))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (628:16): [True: 0, False: 0]
  ------------------
  629|      0|        return 0;
  630|      2|#  endif
  631|       |#  if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
  632|       |    if ((opts & OPENSSL_INIT_ENGINE_CAPI)
  633|       |            && !RUN_ONCE(&engine_capi, ossl_init_engine_capi))
  634|       |        return 0;
  635|       |#  endif
  636|      2|#  if !defined(OPENSSL_NO_AFALGENG)
  637|      2|    if ((opts & OPENSSL_INIT_ENGINE_AFALG)
  ------------------
  |  |  463|      2|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  |  Branch (637:9): [True: 0, False: 2]
  ------------------
  638|      2|            && !RUN_ONCE(&engine_afalg, ossl_init_engine_afalg))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (638:16): [True: 0, False: 0]
  ------------------
  639|      0|        return 0;
  640|      2|#  endif
  641|      2|# endif
  642|      2|    if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN
  ------------------
  |  |  479|      2|    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  457|      2|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  |  |  ------------------
  |  |                   (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  458|      2|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  |  |  ------------------
  |  |  480|      2|    | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  460|      2|# define OPENSSL_INIT_ENGINE_CRYPTODEV       0x00001000L
  |  |  ------------------
  |  |                   | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  461|      2|# define OPENSSL_INIT_ENGINE_CAPI            0x00002000L
  |  |  ------------------
  |  |  481|      2|    OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  462|      2|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  |  |  ------------------
  ------------------
  |  Branch (642:9): [True: 0, False: 2]
  ------------------
  643|      2|                | OPENSSL_INIT_ENGINE_OPENSSL
  ------------------
  |  |  459|      2|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  644|      2|                | OPENSSL_INIT_ENGINE_AFALG)) {
  ------------------
  |  |  463|      2|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  645|      0|        ENGINE_register_all_complete();
  646|      0|    }
  647|      2|#endif
  648|       |
  649|      2|    if (!CRYPTO_atomic_or(&optsdone, opts, &tmp, optsdone_lock))
  ------------------
  |  Branch (649:9): [True: 0, False: 2]
  ------------------
  650|      0|        return 0;
  651|       |
  652|      2|    return 1;
  653|      2|}
init.c:ossl_init_base:
   56|      2|{
   57|       |    /* no need to init trace */
   58|       |
   59|      2|    OSSL_TRACE(INIT, "ossl_init_base: setting up stop handlers\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   60|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
   61|       |    ossl_malloc_setup_failures();
   62|       |#endif
   63|       |
   64|      2|    if ((optsdone_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (64:9): [True: 0, False: 2]
  ------------------
   65|      2|        || (init_lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (65:12): [True: 0, False: 2]
  ------------------
   66|      0|        goto err;
   67|       |
   68|      2|    OPENSSL_cpuid_setup();
   69|       |
   70|      2|    if (!ossl_init_thread())
  ------------------
  |  Branch (70:9): [True: 0, False: 2]
  ------------------
   71|      0|        goto err;
   72|       |
   73|      2|    if (!CRYPTO_THREAD_init_local(&in_init_config_local, NULL))
  ------------------
  |  Branch (73:9): [True: 0, False: 2]
  ------------------
   74|      0|        goto err;
   75|       |
   76|      2|    base_inited = 1;
   77|      2|    return 1;
   78|       |
   79|      0|err:
   80|      0|    OSSL_TRACE(INIT, "ossl_init_base failed!\n");
  ------------------
  |  |  285|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   81|      0|    CRYPTO_THREAD_lock_free(optsdone_lock);
   82|      0|    optsdone_lock = NULL;
   83|      0|    CRYPTO_THREAD_lock_free(init_lock);
   84|      0|    init_lock = NULL;
   85|       |
   86|      0|    return 0;
   87|      2|}
init.c:ossl_init_register_atexit:
   99|      2|{
  100|       |#ifdef OPENSSL_INIT_DEBUG
  101|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_register_atexit()\n");
  102|       |#endif
  103|      2|#ifndef OPENSSL_SYS_UEFI
  104|       |# if defined(_WIN32) && !defined(__BORLANDC__)
  105|       |    /* We use _onexit() in preference because it gets called on DLL unload */
  106|       |    if (_onexit(win32atexit) == NULL)
  107|       |        return 0;
  108|       |# else
  109|      2|    if (atexit(OPENSSL_cleanup) != 0)
  ------------------
  |  Branch (109:9): [True: 0, False: 2]
  ------------------
  110|      0|        return 0;
  111|      2|# endif
  112|      2|#endif
  113|       |
  114|      2|    return 1;
  115|      2|}
init.c:ossl_init_load_crypto_nodelete:
  129|      2|{
  130|      2|    OSSL_TRACE(INIT, "ossl_init_load_crypto_nodelete()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  131|       |
  132|       |#if !defined(OPENSSL_USE_NODELETE) \
  133|       |    && !defined(OPENSSL_NO_PINSHARED)
  134|       |# if defined(DSO_WIN32) && !defined(_WIN32_WCE)
  135|       |    {
  136|       |        HMODULE handle = NULL;
  137|       |        BOOL ret;
  138|       |
  139|       |        /* We don't use the DSO route for WIN32 because there is a better way */
  140|       |        ret = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
  141|       |                                | GET_MODULE_HANDLE_EX_FLAG_PIN,
  142|       |                                (void *)&base_inited, &handle);
  143|       |
  144|       |        OSSL_TRACE1(INIT,
  145|       |                    "ossl_init_load_crypto_nodelete: "
  146|       |                    "obtained DSO reference? %s\n",
  147|       |                    (ret == TRUE ? "No!" : "Yes."));
  148|       |        return (ret == TRUE) ? 1 : 0;
  149|       |    }
  150|       |# elif !defined(DSO_NONE)
  151|       |    /*
  152|       |     * Deliberately leak a reference to ourselves. This will force the library
  153|       |     * to remain loaded until the atexit() handler is run at process exit.
  154|       |     */
  155|       |    {
  156|       |        DSO *dso;
  157|       |        void *err;
  158|       |
  159|       |        if (!err_shelve_state(&err))
  160|       |            return 0;
  161|       |
  162|       |        dso = DSO_dsobyaddr(&base_inited, DSO_FLAG_NO_UNLOAD_ON_FREE);
  163|       |        /*
  164|       |         * In case of No!, it is uncertain our exit()-handlers can still be
  165|       |         * called. After dlclose() the whole library might have been unloaded
  166|       |         * already.
  167|       |         */
  168|       |        OSSL_TRACE1(INIT, "obtained DSO reference? %s\n",
  169|       |                    (dso == NULL ? "No!" : "Yes."));
  170|       |        DSO_free(dso);
  171|       |        err_unshelve_state(err);
  172|       |    }
  173|       |# endif
  174|       |#endif
  175|       |
  176|      2|    return 1;
  177|      2|}
init.c:ossl_init_load_crypto_strings:
  182|      2|{
  183|      2|    int ret = 1;
  184|       |    /*
  185|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
  186|       |     * pulling in all the error strings during static linking
  187|       |     */
  188|      2|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  189|      2|    OSSL_TRACE(INIT, "ossl_err_load_crypto_strings()\n");
  ------------------
  |  |  285|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  280|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  190|      2|    ret = ossl_err_load_crypto_strings();
  191|      2|#endif
  192|      2|    return ret;
  193|      2|}

ossl_init_thread:
  202|      2|{
  203|      2|    if (!CRYPTO_THREAD_init_local(&destructor_key.value,
  ------------------
  |  Branch (203:9): [True: 0, False: 2]
  ------------------
  204|      2|                                  init_thread_destructor))
  205|      0|        return 0;
  206|       |
  207|      2|    return 1;
  208|      2|}
ossl_cleanup_thread:
  211|      2|{
  212|      2|    init_thread_deregister(NULL, 1);
  213|      2|    CRYPTO_THREAD_cleanup_local(&destructor_key.value);
  214|      2|    destructor_key.sane = -1;
  215|      2|}
OPENSSL_thread_stop:
  229|      2|{
  230|      2|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (230:9): [True: 2, False: 0]
  ------------------
  231|      2|        THREAD_EVENT_HANDLER **hands
  232|      2|            = init_get_thread_local(&destructor_key.value, 0, 0);
  233|      2|        init_thread_stop(NULL, hands);
  234|       |
  235|      2|        init_thread_remove_handlers(hands);
  236|      2|        OPENSSL_free(hands);
  ------------------
  |  |  106|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  237|      2|    }
  238|      2|}
ossl_ctx_thread_stop:
  241|      2|{
  242|      2|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (242:9): [True: 2, False: 0]
  ------------------
  243|      2|        THREAD_EVENT_HANDLER **hands
  244|      2|            = init_get_thread_local(&destructor_key.value, 0, 1);
  245|      2|        init_thread_stop(ctx, hands);
  246|      2|    }
  247|      2|}
ossl_init_thread_start:
  354|      2|{
  355|      2|    THREAD_EVENT_HANDLER **hands;
  356|      2|    THREAD_EVENT_HANDLER *hand;
  357|       |#ifdef FIPS_MODULE
  358|       |    OSSL_LIB_CTX *ctx = arg;
  359|       |
  360|       |    /*
  361|       |     * In FIPS mode the list of THREAD_EVENT_HANDLERs is unique per combination
  362|       |     * of OSSL_LIB_CTX and thread. This is because in FIPS mode each
  363|       |     * OSSL_LIB_CTX gets informed about thread stop events individually.
  364|       |     */
  365|       |    CRYPTO_THREAD_LOCAL *local
  366|       |        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX,
  367|       |                                &thread_event_ossl_ctx_method);
  368|       |#else
  369|       |    /*
  370|       |     * Outside of FIPS mode the list of THREAD_EVENT_HANDLERs is unique per
  371|       |     * thread, but may hold multiple OSSL_LIB_CTXs. We only get told about
  372|       |     * thread stop events globally, so we have to ensure all affected
  373|       |     * OSSL_LIB_CTXs are informed.
  374|       |     */
  375|      2|    CRYPTO_THREAD_LOCAL *local = &destructor_key.value;
  376|      2|#endif
  377|       |
  378|      2|    hands = init_get_thread_local(local, 1, 0);
  379|      2|    if (hands == NULL)
  ------------------
  |  Branch (379:9): [True: 0, False: 2]
  ------------------
  380|      0|        return 0;
  381|       |
  382|       |#ifdef FIPS_MODULE
  383|       |    if (*hands == NULL) {
  384|       |        /*
  385|       |         * We've not yet registered any handlers for this thread. We need to get
  386|       |         * libcrypto to tell us about later thread stop events. c_thread_start
  387|       |         * is a callback to libcrypto defined in fipsprov.c
  388|       |         */
  389|       |        if (!c_thread_start(FIPS_get_core_handle(ctx), ossl_arg_thread_stop,
  390|       |                            ctx))
  391|       |            return 0;
  392|       |    }
  393|       |#endif
  394|       |
  395|      2|    hand = OPENSSL_malloc(sizeof(*hand));
  ------------------
  |  |   96|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  396|      2|    if (hand == NULL)
  ------------------
  |  Branch (396:9): [True: 0, False: 2]
  ------------------
  397|      0|        return 0;
  398|       |
  399|      2|    hand->handfn = handfn;
  400|      2|    hand->arg = arg;
  401|      2|#ifndef FIPS_MODULE
  402|      2|    hand->index = index;
  403|      2|#endif
  404|      2|    hand->next = *hands;
  405|      2|    *hands = hand;
  406|       |
  407|      2|    return 1;
  408|      2|}
initthread.c:init_get_thread_local:
   94|      6|{
   95|      6|    THREAD_EVENT_HANDLER **hands = CRYPTO_THREAD_get_local(local);
   96|       |
   97|      6|    if (alloc) {
  ------------------
  |  Branch (97:9): [True: 2, False: 4]
  ------------------
   98|      2|        if (hands == NULL) {
  ------------------
  |  Branch (98:13): [True: 2, False: 0]
  ------------------
   99|       |
  100|      2|            if ((hands = OPENSSL_zalloc(sizeof(*hands))) == NULL)
  ------------------
  |  |   98|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (100:17): [True: 0, False: 2]
  ------------------
  101|      0|                return NULL;
  102|       |
  103|      2|            if (!CRYPTO_THREAD_set_local(local, hands)) {
  ------------------
  |  Branch (103:17): [True: 0, False: 2]
  ------------------
  104|      0|                OPENSSL_free(hands);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  105|      0|                return NULL;
  106|      0|            }
  107|       |
  108|      2|#ifndef FIPS_MODULE
  109|      2|            if (!init_thread_push_handlers(hands)) {
  ------------------
  |  Branch (109:17): [True: 0, False: 2]
  ------------------
  110|      0|                CRYPTO_THREAD_set_local(local, NULL);
  111|      0|                OPENSSL_free(hands);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|      0|                return NULL;
  113|      0|            }
  114|      2|#endif
  115|      2|        }
  116|      4|    } else if (!keep) {
  ------------------
  |  Branch (116:16): [True: 2, False: 2]
  ------------------
  117|      2|        CRYPTO_THREAD_set_local(local, NULL);
  118|      2|    }
  119|       |
  120|      6|    return hands;
  121|      6|}
initthread.c:init_thread_push_handlers:
  154|      2|{
  155|      2|    int ret;
  156|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  157|       |
  158|      2|    gtr = get_global_tevent_register();
  159|      2|    if (gtr == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 2]
  ------------------
  160|      0|        return 0;
  161|       |
  162|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (162:9): [True: 0, False: 2]
  ------------------
  163|      0|        return 0;
  164|      2|    ret = (sk_THREAD_EVENT_HANDLER_PTR_push(gtr->skhands, hands) != 0);
  165|      2|    CRYPTO_THREAD_unlock(gtr->lock);
  166|       |
  167|      2|    return ret;
  168|      2|}
initthread.c:get_global_tevent_register:
   77|      8|{
   78|      8|    if (!RUN_ONCE(&tevent_register_runonce, create_global_tevent_register))
  ------------------
  |  |  130|      8|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 8, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (78:9): [True: 0, False: 8]
  ------------------
   79|      0|        return NULL;
   80|      8|    return glob_tevent_reg;
   81|      8|}
initthread.c:create_global_tevent_register:
   58|      2|{
   59|      2|    glob_tevent_reg = OPENSSL_zalloc(sizeof(*glob_tevent_reg));
  ------------------
  |  |   98|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   60|      2|    if (glob_tevent_reg == NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 2]
  ------------------
   61|      0|        return 0;
   62|       |
   63|      2|    glob_tevent_reg->skhands = sk_THREAD_EVENT_HANDLER_PTR_new_null();
   64|      2|    glob_tevent_reg->lock = CRYPTO_THREAD_lock_new();
   65|      2|    if (glob_tevent_reg->skhands == NULL || glob_tevent_reg->lock == NULL) {
  ------------------
  |  Branch (65:9): [True: 0, False: 2]
  |  Branch (65:45): [True: 0, False: 2]
  ------------------
   66|      0|        sk_THREAD_EVENT_HANDLER_PTR_free(glob_tevent_reg->skhands);
   67|      0|        CRYPTO_THREAD_lock_free(glob_tevent_reg->lock);
   68|      0|        OPENSSL_free(glob_tevent_reg);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   69|      0|        glob_tevent_reg = NULL;
   70|      0|        return 0;
   71|      0|    }
   72|       |
   73|      2|    return 1;
   74|      2|}
initthread.c:init_thread_remove_handlers:
  171|      2|{
  172|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  173|      2|    int i;
  174|       |
  175|      2|    gtr = get_global_tevent_register();
  176|      2|    if (gtr == NULL)
  ------------------
  |  Branch (176:9): [True: 0, False: 2]
  ------------------
  177|      0|        return;
  178|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (178:9): [True: 0, False: 2]
  ------------------
  179|      0|        return;
  180|      2|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (180:17): [True: 2, False: 0]
  ------------------
  181|      2|        THREAD_EVENT_HANDLER **hands
  182|      2|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  183|       |
  184|      2|        if (hands == handsin) {
  ------------------
  |  Branch (184:13): [True: 2, False: 0]
  ------------------
  185|      2|            sk_THREAD_EVENT_HANDLER_PTR_delete(gtr->skhands, i);
  186|      2|            CRYPTO_THREAD_unlock(gtr->lock);
  187|      2|            return;
  188|      2|        }
  189|      2|    }
  190|      0|    CRYPTO_THREAD_unlock(gtr->lock);
  191|      0|    return;
  192|      2|}
initthread.c:init_thread_stop:
  310|      4|{
  311|      4|    THREAD_EVENT_HANDLER *curr, *prev = NULL, *tmp;
  312|      4|#ifndef FIPS_MODULE
  313|      4|    GLOBAL_TEVENT_REGISTER *gtr;
  314|      4|#endif
  315|       |
  316|       |    /* Can't do much about this */
  317|      4|    if (hands == NULL)
  ------------------
  |  Branch (317:9): [True: 2, False: 2]
  ------------------
  318|      2|        return;
  319|       |
  320|      2|#ifndef FIPS_MODULE
  321|      2|    gtr = get_global_tevent_register();
  322|      2|    if (gtr == NULL)
  ------------------
  |  Branch (322:9): [True: 0, False: 2]
  ------------------
  323|      0|        return;
  324|       |
  325|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (325:9): [True: 0, False: 2]
  ------------------
  326|      0|        return;
  327|      2|#endif
  328|       |
  329|      2|    curr = *hands;
  330|      4|    while (curr != NULL) {
  ------------------
  |  Branch (330:12): [True: 2, False: 2]
  ------------------
  331|      2|        if (arg != NULL && curr->arg != arg) {
  ------------------
  |  Branch (331:13): [True: 0, False: 2]
  |  Branch (331:28): [True: 0, False: 0]
  ------------------
  332|      0|            prev = curr;
  333|      0|            curr = curr->next;
  334|      0|            continue;
  335|      0|        }
  336|      2|        curr->handfn(curr->arg);
  337|      2|        if (prev == NULL)
  ------------------
  |  Branch (337:13): [True: 2, False: 0]
  ------------------
  338|      2|            *hands = curr->next;
  339|      0|        else
  340|      0|            prev->next = curr->next;
  341|       |
  342|      2|        tmp = curr;
  343|      2|        curr = curr->next;
  344|       |
  345|      2|        OPENSSL_free(tmp);
  ------------------
  |  |  106|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  346|      2|    }
  347|      2|#ifndef FIPS_MODULE
  348|      2|    CRYPTO_THREAD_unlock(gtr->lock);
  349|      2|#endif
  350|      2|}
initthread.c:init_thread_deregister:
  412|      2|{
  413|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  414|      2|    int i;
  415|       |
  416|      2|    gtr = get_global_tevent_register();
  417|      2|    if (gtr == NULL)
  ------------------
  |  Branch (417:9): [True: 0, False: 2]
  ------------------
  418|      0|        return 0;
  419|      2|    if (!all) {
  ------------------
  |  Branch (419:9): [True: 0, False: 2]
  ------------------
  420|      0|        if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (420:13): [True: 0, False: 0]
  ------------------
  421|      0|            return 0;
  422|      2|    } else {
  423|      2|        glob_tevent_reg = NULL;
  424|      2|    }
  425|      2|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (425:17): [True: 0, False: 2]
  ------------------
  426|      0|        THREAD_EVENT_HANDLER **hands
  427|      0|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  428|      0|        THREAD_EVENT_HANDLER *curr = NULL, *prev = NULL, *tmp;
  429|       |
  430|      0|        if (hands == NULL) {
  ------------------
  |  Branch (430:13): [True: 0, False: 0]
  ------------------
  431|      0|            if (!all)
  ------------------
  |  Branch (431:17): [True: 0, False: 0]
  ------------------
  432|      0|                CRYPTO_THREAD_unlock(gtr->lock);
  433|      0|            return 0;
  434|      0|        }
  435|      0|        curr = *hands;
  436|      0|        while (curr != NULL) {
  ------------------
  |  Branch (436:16): [True: 0, False: 0]
  ------------------
  437|      0|            if (all || curr->index == index) {
  ------------------
  |  Branch (437:17): [True: 0, False: 0]
  |  Branch (437:24): [True: 0, False: 0]
  ------------------
  438|      0|                if (prev != NULL)
  ------------------
  |  Branch (438:21): [True: 0, False: 0]
  ------------------
  439|      0|                    prev->next = curr->next;
  440|      0|                else
  441|      0|                    *hands = curr->next;
  442|      0|                tmp = curr;
  443|      0|                curr = curr->next;
  444|      0|                OPENSSL_free(tmp);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  445|      0|                continue;
  446|      0|            }
  447|      0|            prev = curr;
  448|      0|            curr = curr->next;
  449|      0|        }
  450|      0|        if (all)
  ------------------
  |  Branch (450:13): [True: 0, False: 0]
  ------------------
  451|      0|            OPENSSL_free(hands);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  452|      0|    }
  453|      2|    if (all) {
  ------------------
  |  Branch (453:9): [True: 2, False: 0]
  ------------------
  454|      2|        CRYPTO_THREAD_lock_free(gtr->lock);
  455|      2|        sk_THREAD_EVENT_HANDLER_PTR_free(gtr->skhands);
  456|      2|        OPENSSL_free(gtr);
  ------------------
  |  |  106|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  457|      2|    } else {
  458|      0|        CRYPTO_THREAD_unlock(gtr->lock);
  459|      0|    }
  460|      2|    return 1;
  461|      2|}

OPENSSL_LH_new:
   48|  3.13k|{
   49|  3.13k|    OPENSSL_LHASH *ret;
   50|       |
   51|  3.13k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
  ------------------
  |  |   98|  3.13k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (51:9): [True: 0, False: 3.13k]
  ------------------
   52|       |        /*
   53|       |         * Do not set the error code, because the ERR code uses LHASH
   54|       |         * and we want to avoid possible endless error loop.
   55|       |         * ERR_raise(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE);
   56|       |         */
   57|      0|        return NULL;
   58|      0|    }
   59|  3.13k|    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
  ------------------
  |  |   98|  3.13k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (59:9): [True: 0, False: 3.13k]
  ------------------
   60|      0|        goto err;
   61|  3.13k|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (61:18): [True: 0, False: 3.13k]
  ------------------
   62|  3.13k|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (62:18): [True: 0, False: 3.13k]
  ------------------
   63|  3.13k|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|  3.13k|#define MIN_NODES       16
  ------------------
   64|  3.13k|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|  3.13k|#define MIN_NODES       16
  ------------------
   65|  3.13k|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|  3.13k|#define MIN_NODES       16
  ------------------
   66|  3.13k|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|  3.13k|#define UP_LOAD         (2*LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   78|  3.13k|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   67|  3.13k|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|  3.13k|#define DOWN_LOAD       (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   78|  3.13k|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   68|  3.13k|    return ret;
   69|       |
   70|      0|err:
   71|      0|    OPENSSL_free(ret->b);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|      0|    OPENSSL_free(ret);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|      0|    return NULL;
   74|  3.13k|}
OPENSSL_LH_free:
   77|  3.13k|{
   78|  3.13k|    if (lh == NULL)
  ------------------
  |  Branch (78:9): [True: 2, False: 3.13k]
  ------------------
   79|      2|        return;
   80|       |
   81|  3.13k|    OPENSSL_LH_flush(lh);
   82|  3.13k|    OPENSSL_free(lh->b);
  ------------------
  |  |  106|  3.13k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   83|  3.13k|    OPENSSL_free(lh);
  ------------------
  |  |  106|  3.13k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|  3.13k|}
OPENSSL_LH_flush:
   87|  3.13k|{
   88|  3.13k|    unsigned int i;
   89|  3.13k|    OPENSSL_LH_NODE *n, *nn;
   90|       |
   91|  3.13k|    if (lh == NULL)
  ------------------
  |  Branch (91:9): [True: 0, False: 3.13k]
  ------------------
   92|      0|        return;
   93|       |
   94|  42.0k|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (94:17): [True: 38.8k, False: 3.13k]
  ------------------
   95|  38.8k|        n = lh->b[i];
   96|  55.8k|        while (n != NULL) {
  ------------------
  |  Branch (96:16): [True: 16.9k, False: 38.8k]
  ------------------
   97|  16.9k|            nn = n->next;
   98|  16.9k|            OPENSSL_free(n);
  ------------------
  |  |  106|  16.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  16.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  16.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   99|  16.9k|            n = nn;
  100|  16.9k|        }
  101|  38.8k|        lh->b[i] = NULL;
  102|  38.8k|    }
  103|       |
  104|  3.13k|    lh->num_items = 0;
  105|  3.13k|}
OPENSSL_LH_insert:
  108|  49.8k|{
  109|  49.8k|    unsigned long hash;
  110|  49.8k|    OPENSSL_LH_NODE *nn, **rn;
  111|  49.8k|    void *ret;
  112|       |
  113|  49.8k|    lh->error = 0;
  114|  49.8k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   78|  49.8k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (114:9): [True: 13.7k, False: 36.0k]
  |  Branch (114:76): [True: 0, False: 13.7k]
  ------------------
  115|      0|        return NULL;        /* 'lh->error++' already done in 'expand' */
  116|       |
  117|  49.8k|    rn = getrn(lh, data, &hash);
  118|       |
  119|  49.8k|    if (*rn == NULL) {
  ------------------
  |  Branch (119:9): [True: 37.0k, False: 12.8k]
  ------------------
  120|  37.0k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |   96|  37.0k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  37.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  37.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (120:13): [True: 0, False: 37.0k]
  ------------------
  121|      0|            lh->error++;
  122|      0|            return NULL;
  123|      0|        }
  124|  37.0k|        nn->data = data;
  125|  37.0k|        nn->next = NULL;
  126|  37.0k|        nn->hash = hash;
  127|  37.0k|        *rn = nn;
  128|  37.0k|        ret = NULL;
  129|  37.0k|        lh->num_items++;
  130|  37.0k|    } else {                    /* replace same key */
  131|  12.8k|        ret = (*rn)->data;
  132|  12.8k|        (*rn)->data = data;
  133|  12.8k|    }
  134|  49.8k|    return ret;
  135|  49.8k|}
OPENSSL_LH_delete:
  138|  20.0k|{
  139|  20.0k|    unsigned long hash;
  140|  20.0k|    OPENSSL_LH_NODE *nn, **rn;
  141|  20.0k|    void *ret;
  142|       |
  143|  20.0k|    lh->error = 0;
  144|  20.0k|    rn = getrn(lh, data, &hash);
  145|       |
  146|  20.0k|    if (*rn == NULL) {
  ------------------
  |  Branch (146:9): [True: 0, False: 20.0k]
  ------------------
  147|      0|        return NULL;
  148|  20.0k|    } else {
  149|  20.0k|        nn = *rn;
  150|  20.0k|        *rn = nn->next;
  151|  20.0k|        ret = nn->data;
  152|  20.0k|        OPENSSL_free(nn);
  ------------------
  |  |  106|  20.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  20.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  20.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  153|  20.0k|    }
  154|       |
  155|  20.0k|    lh->num_items--;
  156|  20.0k|    if ((lh->num_nodes > MIN_NODES) &&
  ------------------
  |  |   39|  20.0k|#define MIN_NODES       16
  ------------------
  |  Branch (156:9): [True: 17.0k, False: 3.01k]
  ------------------
  157|  20.0k|        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
  ------------------
  |  |   78|  17.0k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (157:9): [True: 0, False: 17.0k]
  ------------------
  158|      0|        contract(lh);
  159|       |
  160|  20.0k|    return ret;
  161|  20.0k|}
OPENSSL_LH_retrieve:
  164|  26.8k|{
  165|  26.8k|    unsigned long hash;
  166|  26.8k|    OPENSSL_LH_NODE **rn;
  167|       |
  168|  26.8k|    if (lh->error != 0)
  ------------------
  |  Branch (168:9): [True: 0, False: 26.8k]
  ------------------
  169|      0|        lh->error = 0;
  170|       |
  171|  26.8k|    rn = getrn(lh, data, &hash);
  172|       |
  173|  26.8k|    return *rn == NULL ? NULL : (*rn)->data;
  ------------------
  |  Branch (173:12): [True: 14.9k, False: 11.8k]
  ------------------
  174|  26.8k|}
OPENSSL_LH_doall:
  204|  3.13k|{
  205|  3.13k|    doall_util_fn(lh, 0, func, (OPENSSL_LH_DOALL_FUNCARG)0, NULL);
  206|  3.13k|}
OPENSSL_LH_doall_arg:
  209|  3.13k|{
  210|  3.13k|    doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg);
  211|  3.13k|}
OPENSSL_LH_strhash:
  324|   176k|{
  325|   176k|    unsigned long ret = 0;
  326|   176k|    long n;
  327|   176k|    unsigned long v;
  328|   176k|    int r;
  329|       |
  330|   176k|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (330:9): [True: 27.7k, False: 148k]
  |  Branch (330:24): [True: 43.8k, False: 104k]
  ------------------
  331|  71.6k|        return ret;
  332|       |
  333|   104k|    n = 0x100;
  334|  68.3M|    while (*c) {
  ------------------
  |  Branch (334:12): [True: 68.2M, False: 104k]
  ------------------
  335|  68.2M|        v = n | (*c);
  336|  68.2M|        n += 0x100;
  337|  68.2M|        r = (int)((v >> 2) ^ v) & 0x0f;
  338|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  339|  68.2M|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  340|  68.2M|        ret &= 0xFFFFFFFFL;
  341|  68.2M|        ret ^= v * v;
  342|  68.2M|        c++;
  343|  68.2M|    }
  344|   104k|    return (ret >> 16) ^ ret;
  345|   176k|}
OPENSSL_LH_set_down_load:
  380|  3.13k|{
  381|  3.13k|    lh->down_load = down_load;
  382|  3.13k|}
OPENSSL_LH_error:
  385|  14.0k|{
  386|  14.0k|    return lh->error;
  387|  14.0k|}
lhash.c:doall_util_fn:
  179|  6.26k|{
  180|  6.26k|    int i;
  181|  6.26k|    OPENSSL_LH_NODE *a, *n;
  182|       |
  183|  6.26k|    if (lh == NULL)
  ------------------
  |  Branch (183:9): [True: 0, False: 6.26k]
  ------------------
  184|      0|        return;
  185|       |
  186|       |    /*
  187|       |     * reverse the order so we search from 'top to bottom' We were having
  188|       |     * memory leaks otherwise
  189|       |     */
  190|  81.1k|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (190:33): [True: 74.8k, False: 6.26k]
  ------------------
  191|  74.8k|        a = lh->b[i];
  192|   123k|        while (a != NULL) {
  ------------------
  |  Branch (192:16): [True: 48.2k, False: 74.8k]
  ------------------
  193|  48.2k|            n = a->next;
  194|  48.2k|            if (use_arg)
  ------------------
  |  Branch (194:17): [True: 34.1k, False: 14.0k]
  ------------------
  195|  34.1k|                func_arg(a->data, arg);
  196|  14.0k|            else
  197|  14.0k|                func(a->data);
  198|  48.2k|            a = n;
  199|  48.2k|        }
  200|  74.8k|    }
  201|  6.26k|}
lhash.c:expand:
  214|  13.7k|{
  215|  13.7k|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  216|  13.7k|    unsigned int p, pmax, nni, j;
  217|  13.7k|    unsigned long hash;
  218|       |
  219|  13.7k|    nni = lh->num_alloc_nodes;
  220|  13.7k|    p = lh->p;
  221|  13.7k|    pmax = lh->pmax;
  222|  13.7k|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (222:9): [True: 371, False: 13.4k]
  ------------------
  223|    371|        j = nni * 2;
  224|    371|        n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
  ------------------
  |  |  100|    371|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|    371|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|    371|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  225|    371|        if (n == NULL) {
  ------------------
  |  Branch (225:13): [True: 0, False: 371]
  ------------------
  226|      0|            lh->error++;
  227|      0|            return 0;
  228|      0|        }
  229|    371|        lh->b = n;
  230|    371|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  231|    371|        lh->pmax = nni;
  232|    371|        lh->num_alloc_nodes = j;
  233|    371|        lh->p = 0;
  234|  13.4k|    } else {
  235|  13.4k|        lh->p++;
  236|  13.4k|    }
  237|       |
  238|  13.7k|    lh->num_nodes++;
  239|  13.7k|    n1 = &(lh->b[p]);
  240|  13.7k|    n2 = &(lh->b[p + pmax]);
  241|  13.7k|    *n2 = NULL;
  242|       |
  243|  54.4k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (243:20): [True: 40.6k, False: 13.7k]
  ------------------
  244|  40.6k|        hash = np->hash;
  245|  40.6k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (245:13): [True: 16.4k, False: 24.1k]
  ------------------
  246|  16.4k|            *n1 = (*n1)->next;
  247|  16.4k|            np->next = *n2;
  248|  16.4k|            *n2 = np;
  249|  16.4k|        } else
  250|  24.1k|            n1 = &((*n1)->next);
  251|  40.6k|        np = *n1;
  252|  40.6k|    }
  253|       |
  254|  13.7k|    return 1;
  255|  13.7k|}
lhash.c:getrn:
  292|  96.7k|{
  293|  96.7k|    OPENSSL_LH_NODE **ret, *n1;
  294|  96.7k|    unsigned long hash, nn;
  295|  96.7k|    OPENSSL_LH_COMPFUNC cf;
  296|       |
  297|  96.7k|    hash = (*(lh->hash)) (data);
  298|  96.7k|    *rhash = hash;
  299|       |
  300|  96.7k|    nn = hash % lh->pmax;
  301|  96.7k|    if (nn < lh->p)
  ------------------
  |  Branch (301:9): [True: 31.6k, False: 65.0k]
  ------------------
  302|  31.6k|        nn = hash % lh->num_alloc_nodes;
  303|       |
  304|  96.7k|    cf = lh->comp;
  305|  96.7k|    ret = &(lh->b[(int)nn]);
  306|   463k|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (306:21): [True: 411k, False: 51.9k]
  ------------------
  307|   411k|        if (n1->hash != hash) {
  ------------------
  |  Branch (307:13): [True: 331k, False: 79.7k]
  ------------------
  308|   331k|            ret = &(n1->next);
  309|   331k|            continue;
  310|   331k|        }
  311|  79.7k|        if (cf(n1->data, data) == 0)
  ------------------
  |  Branch (311:13): [True: 44.8k, False: 34.9k]
  ------------------
  312|  44.8k|            break;
  313|  34.9k|        ret = &(n1->next);
  314|  34.9k|    }
  315|  96.7k|    return ret;
  316|  96.7k|}

CRYPTO_malloc:
  172|   261k|{
  173|   261k|    INCREMENT(malloc_count);
  174|   261k|    if (malloc_impl != CRYPTO_malloc)
  ------------------
  |  Branch (174:9): [True: 0, False: 261k]
  ------------------
  175|      0|        return malloc_impl(num, file, line);
  176|       |
  177|   261k|    if (num == 0)
  ------------------
  |  Branch (177:9): [True: 0, False: 261k]
  ------------------
  178|      0|        return NULL;
  179|       |
  180|   261k|    FAILTEST();
  181|   261k|    if (allow_customize) {
  ------------------
  |  Branch (181:9): [True: 2, False: 261k]
  ------------------
  182|       |        /*
  183|       |         * Disallow customization after the first allocation. We only set this
  184|       |         * if necessary to avoid a store to the same cache line on every
  185|       |         * allocation.
  186|       |         */
  187|      2|        allow_customize = 0;
  188|      2|    }
  189|       |
  190|   261k|    return malloc(num);
  191|   261k|}
CRYPTO_zalloc:
  194|  83.7k|{
  195|  83.7k|    void *ret;
  196|       |
  197|  83.7k|    ret = CRYPTO_malloc(num, file, line);
  198|  83.7k|    if (ret != NULL)
  ------------------
  |  Branch (198:9): [True: 83.7k, False: 0]
  ------------------
  199|  83.7k|        memset(ret, 0, num);
  200|       |
  201|  83.7k|    return ret;
  202|  83.7k|}
CRYPTO_realloc:
  205|  46.4k|{
  206|  46.4k|    INCREMENT(realloc_count);
  207|  46.4k|    if (realloc_impl != CRYPTO_realloc)
  ------------------
  |  Branch (207:9): [True: 0, False: 46.4k]
  ------------------
  208|      0|        return realloc_impl(str, num, file, line);
  209|       |
  210|  46.4k|    if (str == NULL)
  ------------------
  |  Branch (210:9): [True: 34.7k, False: 11.7k]
  ------------------
  211|  34.7k|        return CRYPTO_malloc(num, file, line);
  212|       |
  213|  11.7k|    if (num == 0) {
  ------------------
  |  Branch (213:9): [True: 0, False: 11.7k]
  ------------------
  214|      0|        CRYPTO_free(str, file, line);
  215|      0|        return NULL;
  216|      0|    }
  217|       |
  218|  11.7k|    FAILTEST();
  219|  11.7k|    return realloc(str, num);
  220|  11.7k|}
CRYPTO_clear_realloc:
  224|  6.12k|{
  225|  6.12k|    void *ret = NULL;
  226|       |
  227|  6.12k|    if (str == NULL)
  ------------------
  |  Branch (227:9): [True: 3.13k, False: 2.99k]
  ------------------
  228|  3.13k|        return CRYPTO_malloc(num, file, line);
  229|       |
  230|  2.99k|    if (num == 0) {
  ------------------
  |  Branch (230:9): [True: 0, False: 2.99k]
  ------------------
  231|      0|        CRYPTO_clear_free(str, old_len, file, line);
  232|      0|        return NULL;
  233|      0|    }
  234|       |
  235|       |    /* Can't shrink the buffer since memcpy below copies |old_len| bytes. */
  236|  2.99k|    if (num < old_len) {
  ------------------
  |  Branch (236:9): [True: 0, False: 2.99k]
  ------------------
  237|      0|        OPENSSL_cleanse((char*)str + num, old_len - num);
  238|      0|        return str;
  239|      0|    }
  240|       |
  241|  2.99k|    ret = CRYPTO_malloc(num, file, line);
  242|  2.99k|    if (ret != NULL) {
  ------------------
  |  Branch (242:9): [True: 2.99k, False: 0]
  ------------------
  243|  2.99k|        memcpy(ret, str, old_len);
  244|  2.99k|        CRYPTO_clear_free(str, old_len, file, line);
  245|  2.99k|    }
  246|  2.99k|    return ret;
  247|  2.99k|}
CRYPTO_free:
  250|   416k|{
  251|   416k|    INCREMENT(free_count);
  252|   416k|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (252:9): [True: 0, False: 416k]
  ------------------
  253|      0|        free_impl(str, file, line);
  254|      0|        return;
  255|      0|    }
  256|       |
  257|   416k|    free(str);
  258|   416k|}
CRYPTO_clear_free:
  261|  9.49k|{
  262|  9.49k|    if (str == NULL)
  ------------------
  |  Branch (262:9): [True: 0, False: 9.49k]
  ------------------
  263|      0|        return;
  264|  9.49k|    if (num)
  ------------------
  |  Branch (264:9): [True: 9.49k, False: 0]
  ------------------
  265|  9.49k|        OPENSSL_cleanse(str, num);
  266|  9.49k|    CRYPTO_free(str, file, line);
  267|  9.49k|}

CRYPTO_secure_malloc_done:
  119|      2|{
  120|      2|#ifndef OPENSSL_NO_SECURE_MEMORY
  121|      2|    if (secure_mem_used == 0) {
  ------------------
  |  Branch (121:9): [True: 2, False: 0]
  ------------------
  122|      2|        sh_done();
  123|      2|        secure_mem_initialized = 0;
  124|      2|        CRYPTO_THREAD_lock_free(sec_malloc_lock);
  125|      2|        sec_malloc_lock = NULL;
  126|      2|        return 1;
  127|      2|    }
  128|      0|#endif /* OPENSSL_NO_SECURE_MEMORY */
  129|      0|    return 0;
  130|      2|}
mem_sec.c:sh_done:
  573|      2|{
  574|      2|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  106|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  575|      2|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  106|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  576|      2|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  106|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  577|      2|#if !defined(_WIN32)
  578|      2|    if (sh.map_result != MAP_FAILED && sh.map_size)
  ------------------
  |  Branch (578:9): [True: 2, False: 0]
  |  Branch (578:40): [True: 0, False: 2]
  ------------------
  579|      0|        munmap(sh.map_result, sh.map_size);
  580|       |#else
  581|       |    if (sh.map_result != NULL && sh.map_size)
  582|       |        VirtualFree(sh.map_result, 0, MEM_RELEASE);
  583|       |#endif
  584|      2|    memset(&sh, 0, sizeof(sh));
  585|      2|}

openssl_fopen:
   39|  1.79k|{
   40|  1.79k|    FILE *file = NULL;
   41|       |# if defined(_WIN32) && defined(CP_UTF8)
   42|       |    int sz, len_0 = (int)strlen(filename) + 1;
   43|       |    DWORD flags;
   44|       |
   45|       |    /*
   46|       |     * Basically there are three cases to cover: a) filename is
   47|       |     * pure ASCII string; b) actual UTF-8 encoded string and
   48|       |     * c) locale-ized string, i.e. one containing 8-bit
   49|       |     * characters that are meaningful in current system locale.
   50|       |     * If filename is pure ASCII or real UTF-8 encoded string,
   51|       |     * MultiByteToWideChar succeeds and _wfopen works. If
   52|       |     * filename is locale-ized string, chances are that
   53|       |     * MultiByteToWideChar fails reporting
   54|       |     * ERROR_NO_UNICODE_TRANSLATION, in which case we fall
   55|       |     * back to fopen...
   56|       |     */
   57|       |    if ((sz = MultiByteToWideChar(CP_UTF8, (flags = MB_ERR_INVALID_CHARS),
   58|       |                                  filename, len_0, NULL, 0)) > 0 ||
   59|       |        (GetLastError() == ERROR_INVALID_FLAGS &&
   60|       |         (sz = MultiByteToWideChar(CP_UTF8, (flags = 0),
   61|       |                                   filename, len_0, NULL, 0)) > 0)
   62|       |        ) {
   63|       |        WCHAR wmode[8];
   64|       |        WCHAR *wfilename = _alloca(sz * sizeof(WCHAR));
   65|       |
   66|       |        if (MultiByteToWideChar(CP_UTF8, flags,
   67|       |                                filename, len_0, wfilename, sz) &&
   68|       |            MultiByteToWideChar(CP_UTF8, 0, mode, strlen(mode) + 1,
   69|       |                                wmode, OSSL_NELEM(wmode)) &&
   70|       |            (file = _wfopen(wfilename, wmode)) == NULL &&
   71|       |            (errno == ENOENT || errno == EBADF)
   72|       |            ) {
   73|       |            /*
   74|       |             * UTF-8 decode succeeded, but no file, filename
   75|       |             * could still have been locale-ized...
   76|       |             */
   77|       |            file = fopen(filename, mode);
   78|       |        }
   79|       |    } else if (GetLastError() == ERROR_NO_UNICODE_TRANSLATION) {
   80|       |        file = fopen(filename, mode);
   81|       |    }
   82|       |# elif defined(__DJGPP__)
   83|       |    {
   84|       |        char *newname = NULL;
   85|       |
   86|       |        if (pathconf(filename, _PC_NAME_MAX) <= 12) {  /* 8.3 file system? */
   87|       |            char *iterator;
   88|       |            char lastchar;
   89|       |
   90|       |            if ((newname = OPENSSL_malloc(strlen(filename) + 1)) == NULL) {
   91|       |                ERR_raise(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE);
   92|       |                return NULL;
   93|       |            }
   94|       |
   95|       |            for (iterator = newname, lastchar = '\0';
   96|       |                *filename; filename++, iterator++) {
   97|       |                if (lastchar == '/' && filename[0] == '.'
   98|       |                    && filename[1] != '.' && filename[1] != '/') {
   99|       |                    /* Leading dots are not permitted in plain DOS. */
  100|       |                    *iterator = '_';
  101|       |                } else {
  102|       |                    *iterator = *filename;
  103|       |                }
  104|       |                lastchar = *filename;
  105|       |            }
  106|       |            *iterator = '\0';
  107|       |            filename = newname;
  108|       |        }
  109|       |        file = fopen(filename, mode);
  110|       |
  111|       |        OPENSSL_free(newname);
  112|       |    }
  113|       |# else
  114|  1.79k|    file = fopen(filename, mode);
  115|  1.79k|# endif
  116|  1.79k|    return file;
  117|  1.79k|}

CRYPTO_strdup:
   22|  40.7k|{
   23|  40.7k|    char *ret;
   24|       |
   25|  40.7k|    if (str == NULL)
  ------------------
  |  Branch (25:9): [True: 0, False: 40.7k]
  ------------------
   26|      0|        return NULL;
   27|  40.7k|    ret = CRYPTO_malloc(strlen(str) + 1, file, line);
   28|  40.7k|    if (ret != NULL)
  ------------------
  |  Branch (28:9): [True: 40.7k, False: 0]
  ------------------
   29|  40.7k|        strcpy(ret, str);
   30|  40.7k|    return ret;
   31|  40.7k|}
OPENSSL_strnlen:
   67|  2.87k|{
   68|  2.87k|    const char *p;
   69|       |
   70|  1.75M|    for (p = str; maxlen-- != 0 && *p != CH_ZERO; ++p) ;
  ------------------
  |  |   19|  1.75M|#define CH_ZERO '\0'
  ------------------
  |  Branch (70:19): [True: 1.75M, False: 1.63k]
  |  Branch (70:36): [True: 1.75M, False: 1.24k]
  ------------------
   71|       |
   72|  2.87k|    return p - str;
   73|  2.87k|}
OPENSSL_strlcpy:
   76|  38.4k|{
   77|  38.4k|    size_t l = 0;
   78|  13.0M|    for (; size > 1 && *src; size--) {
  ------------------
  |  Branch (78:12): [True: 13.0M, False: 1.94k]
  |  Branch (78:24): [True: 13.0M, False: 36.5k]
  ------------------
   79|  13.0M|        *dst++ = *src++;
   80|  13.0M|        l++;
   81|  13.0M|    }
   82|  38.4k|    if (size)
  ------------------
  |  Branch (82:9): [True: 38.4k, False: 0]
  ------------------
   83|  38.4k|        *dst = CH_ZERO;
  ------------------
  |  |   19|  38.4k|#define CH_ZERO '\0'
  ------------------
   84|  38.4k|    return l + strlen(src);
   85|  38.4k|}
OPENSSL_strlcat:
   88|  6.10k|{
   89|  6.10k|    size_t l = 0;
   90|  18.7M|    for (; size > 0 && *dst; size--, dst++)
  ------------------
  |  Branch (90:12): [True: 18.7M, False: 0]
  |  Branch (90:24): [True: 18.7M, False: 6.10k]
  ------------------
   91|  18.7M|        l++;
   92|  6.10k|    return l + OPENSSL_strlcpy(dst, src, size);
   93|  6.10k|}
OPENSSL_strcasecmp:
  346|  44.0k|{
  347|  44.0k|    int t;
  348|       |
  349|  59.7k|    while ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) == 0)
  ------------------
  |  Branch (349:12): [True: 18.7k, False: 40.9k]
  ------------------
  350|  18.7k|        if (*s1++ == '\0')
  ------------------
  |  Branch (350:13): [True: 3.05k, False: 15.7k]
  ------------------
  351|  3.05k|            return 0;
  352|  40.9k|    return t;
  353|  44.0k|}

OBJ_NAME_cleanup:
  369|      8|{
  370|      8|    unsigned long down_load;
  371|       |
  372|      8|    if (names_lh == NULL)
  ------------------
  |  Branch (372:9): [True: 8, False: 0]
  ------------------
  373|      8|        return;
  374|       |
  375|      0|    free_type = type;
  376|      0|    down_load = lh_OBJ_NAME_get_down_load(names_lh);
  377|      0|    lh_OBJ_NAME_set_down_load(names_lh, 0);
  378|       |
  379|      0|    lh_OBJ_NAME_doall(names_lh, names_lh_free_doall);
  380|      0|    if (type < 0) {
  ------------------
  |  Branch (380:9): [True: 0, False: 0]
  ------------------
  381|      0|        lh_OBJ_NAME_free(names_lh);
  382|      0|        sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
  383|      0|        CRYPTO_THREAD_lock_free(obj_lock);
  384|      0|        names_lh = NULL;
  385|      0|        name_funcs_stack = NULL;
  386|      0|        obj_lock = NULL;
  387|      0|    } else
  388|      0|        lh_OBJ_NAME_set_down_load(names_lh, down_load);
  389|      0|}

ossl_obj_cleanup_int:
  154|      2|{
  155|      2|    if (added == NULL)
  ------------------
  |  Branch (155:9): [True: 2, False: 0]
  ------------------
  156|      2|        return;
  157|      0|    lh_ADDED_OBJ_set_down_load(added, 0);
  158|      0|    lh_ADDED_OBJ_doall(added, cleanup1_doall); /* zero counters */
  159|      0|    lh_ADDED_OBJ_doall(added, cleanup2_doall); /* set counters */
  160|      0|    lh_ADDED_OBJ_doall(added, cleanup3_doall); /* free objects */
  161|      0|    lh_ADDED_OBJ_free(added);
  162|      0|    added = NULL;
  163|      0|}

ossl_err_load_OBJ_strings:
   28|      2|{
   29|      2|#ifndef OPENSSL_NO_ERR
   30|      2|    if (ERR_reason_error_string(OBJ_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (30:9): [True: 2, False: 0]
  ------------------
   31|      2|        ERR_load_strings_const(OBJ_str_reasons);
   32|      2|#endif
   33|      2|    return 1;
   34|      2|}

OBJ_sigid_free:
  134|      2|{
  135|      2|    sk_nid_triple_pop_free(sig_app, sid_free);
  136|      2|    sig_app = NULL;
  137|      2|    sk_nid_triple_free(sigx_app);
  138|      2|    sigx_app = NULL;
  139|      2|}

ossl_err_load_OCSP_strings:
   66|      2|{
   67|      2|# ifndef OPENSSL_NO_ERR
   68|      2|    if (ERR_reason_error_string(OCSP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (68:9): [True: 2, False: 0]
  ------------------
   69|      2|        ERR_load_strings_const(OCSP_str_reasons);
   70|      2|# endif
   71|      2|    return 1;
   72|      2|}

ossl_err_load_PEM_strings:
   68|      2|{
   69|      2|#ifndef OPENSSL_NO_ERR
   70|      2|    if (ERR_reason_error_string(PEM_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 2, False: 0]
  ------------------
   71|      2|        ERR_load_strings_const(PEM_str_reasons);
   72|      2|#endif
   73|      2|    return 1;
   74|      2|}

ossl_err_load_PKCS12_strings:
   55|      2|{
   56|      2|#ifndef OPENSSL_NO_ERR
   57|      2|    if (ERR_reason_error_string(PKCS12_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (57:9): [True: 2, False: 0]
  ------------------
   58|      2|        ERR_load_strings_const(PKCS12_str_reasons);
   59|      2|#endif
   60|      2|    return 1;
   61|      2|}

ossl_err_load_PKCS7_strings:
   92|      2|{
   93|      2|#ifndef OPENSSL_NO_ERR
   94|      2|    if (ERR_reason_error_string(PKCS7_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (94:9): [True: 2, False: 0]
  ------------------
   95|      2|        ERR_load_strings_const(PKCS7_str_reasons);
   96|      2|#endif
   97|      2|    return 1;
   98|      2|}

ossl_err_load_PROP_strings:
   40|      2|{
   41|      2|#ifndef OPENSSL_NO_ERR
   42|      2|    if (ERR_reason_error_string(PROP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (42:9): [True: 2, False: 0]
  ------------------
   43|      2|        ERR_load_strings_const(PROP_str_reasons);
   44|      2|#endif
   45|      2|    return 1;
   46|      2|}

ossl_property_parse_init:
  545|      2|{
  546|      2|    static const char *const predefined_names[] = {
  547|      2|        "provider",     /* Name of provider (default, legacy, fips) */
  548|      2|        "version",      /* Version number of this provider */
  549|      2|        "fips",         /* FIPS validated or FIPS supporting algorithm */
  550|      2|        "output",       /* Output type for encoders */
  551|      2|        "input",        /* Input type for decoders */
  552|      2|        "structure",    /* Structure name for encoders and decoders */
  553|      2|    };
  554|      2|    size_t i;
  555|       |
  556|     14|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|     14|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (556:17): [True: 12, False: 2]
  ------------------
  557|     12|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (557:13): [True: 0, False: 12]
  ------------------
  558|      0|            goto err;
  559|       |
  560|       |    /*
  561|       |     * Pre-populate the two Boolean values. We must do them before any other
  562|       |     * values and in this order so that we get the same index as the global
  563|       |     * OSSL_PROPERTY_TRUE and OSSL_PROPERTY_FALSE values
  564|       |     */
  565|      2|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   37|      2|#define OSSL_PROPERTY_TRUE      1
  ------------------
  |  Branch (565:9): [True: 0, False: 2]
  ------------------
  566|      2|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   38|      2|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (566:12): [True: 0, False: 2]
  ------------------
  567|      0|        goto err;
  568|       |
  569|      2|    return 1;
  570|      0|err:
  571|      0|    return 0;
  572|      2|}

ossl_property_name:
  212|     12|{
  213|     12|    PROPERTY_STRING_DATA *propdata
  214|     12|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX,
  ------------------
  |  |  153|     12|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  215|     12|                                &property_string_data_method);
  216|       |
  217|     12|    if (propdata == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 12]
  ------------------
  218|      0|        return 0;
  219|     12|    return ossl_property_string(propdata->lock, propdata->prop_names,
  220|     12|                                create ? &propdata->prop_name_idx : NULL,
  ------------------
  |  Branch (220:33): [True: 12, False: 0]
  ------------------
  221|     12|                                s);
  222|     12|}
ossl_property_value:
  231|      4|{
  232|      4|    PROPERTY_STRING_DATA *propdata
  233|      4|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX,
  ------------------
  |  |  153|      4|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  234|      4|                                &property_string_data_method);
  235|       |
  236|      4|    if (propdata == NULL)
  ------------------
  |  Branch (236:9): [True: 0, False: 4]
  ------------------
  237|      0|        return 0;
  238|      4|    return ossl_property_string(propdata->lock, propdata->prop_values,
  239|      4|                                create ? &propdata->prop_value_idx : NULL,
  ------------------
  |  Branch (239:33): [True: 4, False: 0]
  ------------------
  240|      4|                                s);
  241|      4|}
property_string.c:property_string_data_new:
   86|      2|static void *property_string_data_new(OSSL_LIB_CTX *ctx) {
   87|      2|    PROPERTY_STRING_DATA *propdata = OPENSSL_zalloc(sizeof(*propdata));
  ------------------
  |  |   98|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   88|       |
   89|      2|    if (propdata == NULL)
  ------------------
  |  Branch (89:9): [True: 0, False: 2]
  ------------------
   90|      0|        return NULL;
   91|       |
   92|      2|    propdata->lock = CRYPTO_THREAD_lock_new();
   93|      2|    if (propdata->lock == NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 2]
  ------------------
   94|      0|        goto err;
   95|       |
   96|      2|    propdata->prop_names = lh_PROPERTY_STRING_new(&property_hash,
   97|      2|                                                  &property_cmp);
   98|      2|    if (propdata->prop_names == NULL)
  ------------------
  |  Branch (98:9): [True: 0, False: 2]
  ------------------
   99|      0|        goto err;
  100|       |
  101|      2|    propdata->prop_values = lh_PROPERTY_STRING_new(&property_hash,
  102|      2|                                                   &property_cmp);
  103|      2|    if (propdata->prop_values == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 2]
  ------------------
  104|      0|        goto err;
  105|       |
  106|      2|    return propdata;
  107|       |
  108|      0|err:
  109|      0|    property_string_data_free(propdata);
  110|      0|    return NULL;
  111|      2|}
property_string.c:property_hash:
   46|     48|{
   47|     48|    return OPENSSL_LH_strhash(a->s);
   48|     48|}
property_string.c:property_string_data_free:
   72|      2|{
   73|      2|    PROPERTY_STRING_DATA *propdata = vpropdata;
   74|       |
   75|      2|    if (propdata == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 2]
  ------------------
   76|      0|        return;
   77|       |
   78|      2|    CRYPTO_THREAD_lock_free(propdata->lock);
   79|      2|    property_table_free(&propdata->prop_names);
   80|      2|    property_table_free(&propdata->prop_values);
   81|      2|    propdata->prop_name_idx = propdata->prop_value_idx = 0;
   82|       |
   83|      2|    OPENSSL_free(propdata);
  ------------------
  |  |  106|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|      2|}
property_string.c:property_table_free:
   61|      4|{
   62|      4|    PROP_TABLE *t = *pt;
   63|       |
   64|      4|    if (t != NULL) {
  ------------------
  |  Branch (64:9): [True: 4, False: 0]
  ------------------
   65|      4|        lh_PROPERTY_STRING_doall(t, &property_free);
   66|      4|        lh_PROPERTY_STRING_free(t);
   67|      4|        *pt = NULL;
   68|      4|    }
   69|      4|}
property_string.c:property_free:
   56|     16|{
   57|     16|    OPENSSL_free(ps);
  ------------------
  |  |  106|     16|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   58|     16|}
property_string.c:ossl_property_string:
  141|     16|{
  142|     16|    PROPERTY_STRING p, *ps, *ps_new;
  143|       |
  144|     16|    p.s = s;
  145|     16|    if (!CRYPTO_THREAD_read_lock(lock)) {
  ------------------
  |  Branch (145:9): [True: 0, False: 16]
  ------------------
  146|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  147|      0|        return 0;
  148|      0|    }
  149|     16|    ps = lh_PROPERTY_STRING_retrieve(t, &p);
  150|     16|    if (ps == NULL && pidx != NULL) {
  ------------------
  |  Branch (150:9): [True: 16, False: 0]
  |  Branch (150:23): [True: 16, False: 0]
  ------------------
  151|     16|        CRYPTO_THREAD_unlock(lock);
  152|     16|        if (!CRYPTO_THREAD_write_lock(lock)) {
  ------------------
  |  Branch (152:13): [True: 0, False: 16]
  ------------------
  153|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  154|      0|            return 0;
  155|      0|        }
  156|     16|        ps = lh_PROPERTY_STRING_retrieve(t, &p);
  157|     16|        if (ps == NULL && (ps_new = new_property_string(s, pidx)) != NULL) {
  ------------------
  |  Branch (157:13): [True: 16, False: 0]
  |  Branch (157:27): [True: 16, False: 0]
  ------------------
  158|     16|            lh_PROPERTY_STRING_insert(t, ps_new);
  159|     16|            if (lh_PROPERTY_STRING_error(t)) {
  ------------------
  |  Branch (159:17): [True: 0, False: 16]
  ------------------
  160|      0|                property_free(ps_new);
  161|      0|                CRYPTO_THREAD_unlock(lock);
  162|      0|                return 0;
  163|      0|            }
  164|     16|            ps = ps_new;
  165|     16|        }
  166|     16|    }
  167|     16|    CRYPTO_THREAD_unlock(lock);
  168|     16|    return ps != NULL ? ps->idx : 0;
  ------------------
  |  Branch (168:12): [True: 16, False: 0]
  ------------------
  169|     16|}
property_string.c:new_property_string:
  121|     16|{
  122|     16|    const size_t l = strlen(s);
  123|     16|    PROPERTY_STRING *ps = OPENSSL_malloc(sizeof(*ps) + l);
  ------------------
  |  |   96|     16|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  124|       |
  125|     16|    if (ps != NULL) {
  ------------------
  |  Branch (125:9): [True: 16, False: 0]
  ------------------
  126|     16|        memcpy(ps->body, s, l + 1);
  127|     16|        ps->s = ps->body;
  128|     16|        ps->idx = ++*pidx;
  129|     16|        if (ps->idx == 0) {
  ------------------
  |  Branch (129:13): [True: 0, False: 16]
  ------------------
  130|      0|            OPENSSL_free(ps);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  131|      0|            return NULL;
  132|      0|        }
  133|     16|    }
  134|     16|    return ps;
  135|     16|}

ossl_err_load_RAND_strings:
  101|      2|{
  102|      2|#ifndef OPENSSL_NO_ERR
  103|      2|    if (ERR_reason_error_string(RAND_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (103:9): [True: 2, False: 0]
  ------------------
  104|      2|        ERR_load_strings_const(RAND_str_reasons);
  105|      2|#endif
  106|      2|    return 1;
  107|      2|}

ossl_rand_cleanup_int:
   79|      2|{
   80|      2|# ifndef OPENSSL_NO_DEPRECATED_3_0
   81|      2|    const RAND_METHOD *meth = default_RAND_meth;
   82|       |
   83|      2|    if (!rand_inited)
  ------------------
  |  Branch (83:9): [True: 2, False: 0]
  ------------------
   84|      2|        return;
   85|       |
   86|      0|    if (meth != NULL && meth->cleanup != NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 0]
  |  Branch (86:25): [True: 0, False: 0]
  ------------------
   87|      0|        meth->cleanup();
   88|      0|    RAND_set_rand_method(NULL);
   89|      0|# endif
   90|      0|    ossl_rand_pool_cleanup();
   91|      0|# ifndef OPENSSL_NO_ENGINE
   92|      0|    CRYPTO_THREAD_lock_free(rand_engine_lock);
   93|      0|    rand_engine_lock = NULL;
   94|      0|# endif
   95|      0|# ifndef OPENSSL_NO_DEPRECATED_3_0
   96|      0|    CRYPTO_THREAD_lock_free(rand_meth_lock);
   97|      0|    rand_meth_lock = NULL;
   98|      0|# endif
   99|      0|    ossl_release_default_drbg_ctx();
  100|      0|    rand_inited = 0;
  101|      0|}

ossl_err_load_RSA_strings:
  160|      2|{
  161|      2|#ifndef OPENSSL_NO_ERR
  162|      2|    if (ERR_reason_error_string(RSA_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (162:9): [True: 2, False: 0]
  ------------------
  163|      2|        ERR_load_strings_const(RSA_str_reasons);
  164|      2|#endif
  165|      2|    return 1;
  166|      2|}

OPENSSL_sk_new_null:
  130|  14.1k|{
  131|  14.1k|    return OPENSSL_sk_new_reserve(NULL, 0);
  132|  14.1k|}
OPENSSL_sk_new_reserve:
  227|  14.1k|{
  228|  14.1k|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |   98|  14.1k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  14.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  14.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  229|       |
  230|  14.1k|    if (st == NULL) {
  ------------------
  |  Branch (230:9): [True: 0, False: 14.1k]
  ------------------
  231|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  232|      0|        return NULL;
  233|      0|    }
  234|       |
  235|  14.1k|    st->comp = c;
  236|       |
  237|  14.1k|    if (n <= 0)
  ------------------
  |  Branch (237:9): [True: 14.1k, False: 0]
  ------------------
  238|  14.1k|        return st;
  239|       |
  240|      0|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (240:9): [True: 0, False: 0]
  ------------------
  241|      0|        OPENSSL_sk_free(st);
  242|      0|        return NULL;
  243|      0|    }
  244|       |
  245|      0|    return st;
  246|      0|}
OPENSSL_sk_insert:
  261|  27.4k|{
  262|  27.4k|    if (st == NULL) {
  ------------------
  |  Branch (262:9): [True: 0, False: 27.4k]
  ------------------
  263|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  264|      0|        return 0;
  265|      0|    }
  266|  27.4k|    if (st->num == max_nodes) {
  ------------------
  |  Branch (266:9): [True: 0, False: 27.4k]
  ------------------
  267|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  268|      0|        return 0;
  269|      0|    }
  270|       |
  271|  27.4k|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (271:9): [True: 0, False: 27.4k]
  ------------------
  272|      0|        return 0;
  273|       |
  274|  27.4k|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (274:9): [True: 27.4k, False: 0]
  |  Branch (274:29): [True: 0, False: 0]
  ------------------
  275|  27.4k|        st->data[st->num] = data;
  276|  27.4k|    } else {
  277|      0|        memmove(&st->data[loc + 1], &st->data[loc],
  278|      0|                sizeof(st->data[0]) * (st->num - loc));
  279|      0|        st->data[loc] = data;
  280|      0|    }
  281|  27.4k|    st->num++;
  282|  27.4k|    st->sorted = 0;
  283|  27.4k|    return st->num;
  284|  27.4k|}
OPENSSL_sk_delete_ptr:
  299|  7.25k|{
  300|  7.25k|    int i;
  301|       |
  302|  7.25k|    if (st == NULL)
  ------------------
  |  Branch (302:9): [True: 0, False: 7.25k]
  ------------------
  303|      0|        return NULL;
  304|       |
  305|  15.2k|    for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (305:17): [True: 15.2k, False: 0]
  ------------------
  306|  15.2k|        if (st->data[i] == p)
  ------------------
  |  Branch (306:13): [True: 7.25k, False: 7.96k]
  ------------------
  307|  7.25k|            return internal_delete(st, i);
  308|      0|    return NULL;
  309|  7.25k|}
OPENSSL_sk_delete:
  312|      2|{
  313|      2|    if (st == NULL || loc < 0 || loc >= st->num)
  ------------------
  |  Branch (313:9): [True: 0, False: 2]
  |  Branch (313:23): [True: 0, False: 2]
  |  Branch (313:34): [True: 0, False: 2]
  ------------------
  314|      0|        return NULL;
  315|       |
  316|      2|    return internal_delete(st, loc);
  317|      2|}
OPENSSL_sk_push:
  385|  27.4k|{
  386|  27.4k|    if (st == NULL)
  ------------------
  |  Branch (386:9): [True: 0, False: 27.4k]
  ------------------
  387|      0|        return -1;
  388|  27.4k|    return OPENSSL_sk_insert(st, data, st->num);
  389|  27.4k|}
OPENSSL_sk_pop:
  404|  2.11k|{
  405|  2.11k|    if (st == NULL || st->num == 0)
  ------------------
  |  Branch (405:9): [True: 1.97k, False: 144]
  |  Branch (405:23): [True: 7, False: 137]
  ------------------
  406|  1.98k|        return NULL;
  407|    137|    return internal_delete(st, st->num - 1);
  408|  2.11k|}
OPENSSL_sk_pop_free:
  419|     40|{
  420|     40|    int i;
  421|       |
  422|     40|    if (st == NULL)
  ------------------
  |  Branch (422:9): [True: 38, False: 2]
  ------------------
  423|     38|        return;
  424|      6|    for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (424:17): [True: 4, False: 2]
  ------------------
  425|      4|        if (st->data[i] != NULL)
  ------------------
  |  Branch (425:13): [True: 2, False: 2]
  ------------------
  426|      2|            func((char *)st->data[i]);
  427|      2|    OPENSSL_sk_free(st);
  428|      2|}
OPENSSL_sk_free:
  431|  20.6k|{
  432|  20.6k|    if (st == NULL)
  ------------------
  |  Branch (432:9): [True: 6.44k, False: 14.1k]
  ------------------
  433|  6.44k|        return;
  434|  14.1k|    OPENSSL_free(st->data);
  ------------------
  |  |  106|  14.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  14.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  14.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  435|  14.1k|    OPENSSL_free(st);
  ------------------
  |  |  106|  14.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  14.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  14.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  436|  14.1k|}
OPENSSL_sk_num:
  439|  22.0k|{
  440|  22.0k|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (440:12): [True: 7.86k, False: 14.2k]
  ------------------
  441|  22.0k|}
OPENSSL_sk_value:
  444|  20.1k|{
  445|  20.1k|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (445:9): [True: 0, False: 20.1k]
  |  Branch (445:23): [True: 0, False: 20.1k]
  |  Branch (445:32): [True: 0, False: 20.1k]
  ------------------
  446|      0|        return NULL;
  447|  20.1k|    return (void *)st->data[i];
  448|  20.1k|}
OPENSSL_sk_set:
  451|      4|{
  452|      4|    if (st == NULL) {
  ------------------
  |  Branch (452:9): [True: 0, False: 4]
  ------------------
  453|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  454|      0|        return NULL;
  455|      0|    }
  456|      4|    if (i < 0 || i >= st->num) {
  ------------------
  |  Branch (456:9): [True: 0, False: 4]
  |  Branch (456:18): [True: 0, False: 4]
  ------------------
  457|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  357|      0|# define ERR_R_PASSED_INVALID_ARGUMENT           (262|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  458|      0|                       "i=%d", i);
  459|      0|        return NULL;
  460|      0|    }
  461|      4|    st->data[i] = data;
  462|      4|    st->sorted = 0;
  463|      4|    return (void *)st->data[i];
  464|      4|}
stack.c:sk_reserve:
  174|  27.4k|{
  175|  27.4k|    const void **tmpdata;
  176|  27.4k|    int num_alloc;
  177|       |
  178|       |    /* Check to see the reservation isn't exceeding the hard limit */
  179|  27.4k|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (179:9): [True: 0, False: 27.4k]
  ------------------
  180|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  181|      0|        return 0;
  182|      0|    }
  183|       |
  184|       |    /* Figure out the new size */
  185|  27.4k|    num_alloc = st->num + n;
  186|  27.4k|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (186:9): [True: 18.6k, False: 8.85k]
  ------------------
  187|  18.6k|        num_alloc = min_nodes;
  188|       |
  189|       |    /* If |st->data| allocation was postponed */
  190|  27.4k|    if (st->data == NULL) {
  ------------------
  |  Branch (190:9): [True: 10.5k, False: 16.9k]
  ------------------
  191|       |        /*
  192|       |         * At this point, |st->num_alloc| and |st->num| are 0;
  193|       |         * so |num_alloc| value is |n| or |min_nodes| if greater than |n|.
  194|       |         */
  195|  10.5k|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL) {
  ------------------
  |  |   98|  10.5k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  10.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  10.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (195:13): [True: 0, False: 10.5k]
  ------------------
  196|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  197|      0|            return 0;
  198|      0|        }
  199|  10.5k|        st->num_alloc = num_alloc;
  200|  10.5k|        return 1;
  201|  10.5k|    }
  202|       |
  203|  16.9k|    if (!exact) {
  ------------------
  |  Branch (203:9): [True: 16.9k, False: 0]
  ------------------
  204|  16.9k|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (204:13): [True: 14.7k, False: 2.21k]
  ------------------
  205|  14.7k|            return 1;
  206|  2.21k|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  207|  2.21k|        if (num_alloc == 0) {
  ------------------
  |  Branch (207:13): [True: 0, False: 2.21k]
  ------------------
  208|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  209|      0|            return 0;
  210|      0|        }
  211|  2.21k|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (211:16): [True: 0, False: 0]
  ------------------
  212|      0|        return 1;
  213|      0|    }
  214|       |
  215|  2.21k|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  100|  2.21k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  2.21k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  2.21k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  216|  2.21k|    if (tmpdata == NULL) {
  ------------------
  |  Branch (216:9): [True: 0, False: 2.21k]
  ------------------
  217|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  288|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  218|      0|        return 0;
  219|      0|    }
  220|       |
  221|  2.21k|    st->data = tmpdata;
  222|  2.21k|    st->num_alloc = num_alloc;
  223|  2.21k|    return 1;
  224|  2.21k|}
stack.c:compute_growth:
  158|  2.21k|{
  159|  2.21k|    const int limit = (max_nodes / 3) * 2 + (max_nodes % 3 ? 1 : 0);
  ------------------
  |  Branch (159:46): [Folded - Ignored]
  ------------------
  160|       |
  161|  4.42k|    while (current < target) {
  ------------------
  |  Branch (161:12): [True: 2.21k, False: 2.21k]
  ------------------
  162|       |        /* Check to see if we're at the hard limit */
  163|  2.21k|        if (current >= max_nodes)
  ------------------
  |  Branch (163:13): [True: 0, False: 2.21k]
  ------------------
  164|      0|            return 0;
  165|       |
  166|       |        /* Expand the size by a factor of 3/2 if it is within range */
  167|  2.21k|        current = current < limit ? current + current / 2 : max_nodes;
  ------------------
  |  Branch (167:19): [True: 2.21k, False: 0]
  ------------------
  168|  2.21k|    }
  169|  2.21k|    return current;
  170|  2.21k|}
stack.c:internal_delete:
  287|  7.39k|{
  288|  7.39k|    const void *ret = st->data[loc];
  289|       |
  290|  7.39k|    if (loc != st->num - 1)
  ------------------
  |  Branch (290:9): [True: 7.25k, False: 139]
  ------------------
  291|  7.25k|        memmove(&st->data[loc], &st->data[loc + 1],
  292|  7.25k|                sizeof(st->data[0]) * (st->num - loc - 1));
  293|  7.39k|    st->num--;
  294|       |
  295|  7.39k|    return (void *)ret;
  296|  7.39k|}

ossl_err_load_OSSL_STORE_strings:
   69|      2|{
   70|      2|#ifndef OPENSSL_NO_ERR
   71|      2|    if (ERR_reason_error_string(OSSL_STORE_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (71:9): [True: 2, False: 0]
  ------------------
   72|      2|        ERR_load_strings_const(OSSL_STORE_str_reasons);
   73|      2|#endif
   74|      2|    return 1;
   75|      2|}

ossl_store_cleanup_int:
   14|      2|{
   15|      2|    ossl_store_destroy_loaders_int();
   16|      2|}

ossl_store_destroy_loaders_int:
  280|      2|{
  281|      2|    lh_OSSL_STORE_LOADER_free(loader_register);
  282|      2|    loader_register = NULL;
  283|      2|    CRYPTO_THREAD_lock_free(registry_lock);
  284|      2|    registry_lock = NULL;
  285|      2|}

CRYPTO_THREAD_lock_new:
   46|  3.44k|{
   47|  3.44k|# ifdef USE_RWLOCK
   48|  3.44k|    CRYPTO_RWLOCK *lock;
   49|       |
   50|  3.44k|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL) {
  ------------------
  |  |   98|  3.44k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.44k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.44k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (50:9): [True: 0, False: 3.44k]
  ------------------
   51|       |        /* Don't set error, to avoid recursion blowup. */
   52|      0|        return NULL;
   53|      0|    }
   54|       |
   55|  3.44k|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (55:9): [True: 0, False: 3.44k]
  ------------------
   56|      0|        OPENSSL_free(lock);
  ------------------
  |  |  106|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   57|      0|        return NULL;
   58|      0|    }
   59|       |# else
   60|       |    pthread_mutexattr_t attr;
   61|       |    CRYPTO_RWLOCK *lock;
   62|       |
   63|       |    if ((lock = OPENSSL_zalloc(sizeof(pthread_mutex_t))) == NULL) {
   64|       |        /* Don't set error, to avoid recursion blowup. */
   65|       |        return NULL;
   66|       |    }
   67|       |
   68|       |    /*
   69|       |     * We don't use recursive mutexes, but try to catch errors if we do.
   70|       |     */
   71|       |    pthread_mutexattr_init(&attr);
   72|       |#  if !defined (__TANDEM) && !defined (_SPT_MODEL_)
   73|       |#   if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
   74|       |    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
   75|       |#   endif
   76|       |#  else
   77|       |    /* The SPT Thread Library does not define MUTEX attributes. */
   78|       |#  endif
   79|       |
   80|       |    if (pthread_mutex_init(lock, &attr) != 0) {
   81|       |        pthread_mutexattr_destroy(&attr);
   82|       |        OPENSSL_free(lock);
   83|       |        return NULL;
   84|       |    }
   85|       |
   86|       |    pthread_mutexattr_destroy(&attr);
   87|       |# endif
   88|       |
   89|  3.44k|    return lock;
   90|  3.44k|}
CRYPTO_THREAD_read_lock:
   93|    198|{
   94|    198|# ifdef USE_RWLOCK
   95|    198|    if (pthread_rwlock_rdlock(lock) != 0)
  ------------------
  |  Branch (95:9): [True: 0, False: 198]
  ------------------
   96|      0|        return 0;
   97|       |# else
   98|       |    if (pthread_mutex_lock(lock) != 0) {
   99|       |        assert(errno != EDEADLK && errno != EBUSY);
  100|       |        return 0;
  101|       |    }
  102|       |# endif
  103|       |
  104|    198|    return 1;
  105|    198|}
CRYPTO_THREAD_write_lock:
  108|  7.02k|{
  109|  7.02k|# ifdef USE_RWLOCK
  110|  7.02k|    if (pthread_rwlock_wrlock(lock) != 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 7.02k]
  ------------------
  111|      0|        return 0;
  112|       |# else
  113|       |    if (pthread_mutex_lock(lock) != 0) {
  114|       |        assert(errno != EDEADLK && errno != EBUSY);
  115|       |        return 0;
  116|       |    }
  117|       |# endif
  118|       |
  119|  7.02k|    return 1;
  120|  7.02k|}
CRYPTO_THREAD_unlock:
  123|  7.22k|{
  124|  7.22k|# ifdef USE_RWLOCK
  125|  7.22k|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (125:9): [True: 0, False: 7.22k]
  ------------------
  126|      0|        return 0;
  127|       |# else
  128|       |    if (pthread_mutex_unlock(lock) != 0) {
  129|       |        assert(errno != EPERM);
  130|       |        return 0;
  131|       |    }
  132|       |# endif
  133|       |
  134|  7.22k|    return 1;
  135|  7.22k|}
CRYPTO_THREAD_lock_free:
  138|  3.45k|{
  139|  3.45k|    if (lock == NULL)
  ------------------
  |  Branch (139:9): [True: 10, False: 3.44k]
  ------------------
  140|     10|        return;
  141|       |
  142|  3.44k|# ifdef USE_RWLOCK
  143|  3.44k|    pthread_rwlock_destroy(lock);
  144|       |# else
  145|       |    pthread_mutex_destroy(lock);
  146|       |# endif
  147|  3.44k|    OPENSSL_free(lock);
  ------------------
  |  |  106|  3.44k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  267|  3.44k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  268|  3.44k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|       |
  149|  3.44k|    return;
  150|  3.45k|}
CRYPTO_THREAD_run_once:
  153|  46.9k|{
  154|  46.9k|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (154:9): [True: 0, False: 46.9k]
  ------------------
  155|      0|        return 0;
  156|       |
  157|  46.9k|    return 1;
  158|  46.9k|}
CRYPTO_THREAD_init_local:
  161|      8|{
  162|      8|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (162:9): [True: 0, False: 8]
  ------------------
  163|      0|        return 0;
  164|       |
  165|      8|    return 1;
  166|      8|}
CRYPTO_THREAD_get_local:
  169|  26.7k|{
  170|  26.7k|    return pthread_getspecific(*key);
  171|  26.7k|}
CRYPTO_THREAD_set_local:
  174|     10|{
  175|     10|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (175:9): [True: 0, False: 10]
  ------------------
  176|      0|        return 0;
  177|       |
  178|     10|    return 1;
  179|     10|}
CRYPTO_THREAD_cleanup_local:
  182|      8|{
  183|      8|    if (pthread_key_delete(*key) != 0)
  ------------------
  |  Branch (183:9): [True: 0, False: 8]
  ------------------
  184|      0|        return 0;
  185|       |
  186|      8|    return 1;
  187|      8|}
CRYPTO_atomic_or:
  227|      2|{
  228|      2|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  229|      2|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (229:9): [Folded - Ignored]
  ------------------
  230|      2|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
  231|      2|        return 1;
  232|      2|    }
  233|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  234|       |    /* This will work for all future Solaris versions. */
  235|       |    if (ret != NULL) {
  236|       |        *ret = atomic_or_64_nv(val, op);
  237|       |        return 1;
  238|       |    }
  239|       |# endif
  240|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (240:9): [True: 0, False: 0]
  |  Branch (240:25): [True: 0, False: 0]
  ------------------
  241|      0|        return 0;
  242|      0|    *val |= op;
  243|      0|    *ret  = *val;
  244|       |
  245|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (245:9): [True: 0, False: 0]
  ------------------
  246|      0|        return 0;
  247|       |
  248|      0|    return 1;
  249|      0|}
CRYPTO_atomic_load:
  252|  20.0k|{
  253|  20.0k|# if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS)
  254|  20.0k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (254:9): [Folded - Ignored]
  ------------------
  255|  20.0k|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  256|  20.0k|        return 1;
  257|  20.0k|    }
  258|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  259|       |    /* This will work for all future Solaris versions. */
  260|       |    if (ret != NULL) {
  261|       |        *ret = atomic_or_64_nv(val, 0);
  262|       |        return 1;
  263|       |    }
  264|       |# endif
  265|      0|    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (265:9): [True: 0, False: 0]
  |  Branch (265:25): [True: 0, False: 0]
  ------------------
  266|      0|        return 0;
  267|      0|    *ret  = *val;
  268|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (268:9): [True: 0, False: 0]
  ------------------
  269|      0|        return 0;
  270|       |
  271|      0|    return 1;
  272|      0|}

ossl_trace_cleanup:
  336|      2|{
  337|       |#ifndef OPENSSL_NO_TRACE
  338|       |    int category;
  339|       |    BIO *channel = NULL;
  340|       |    const char *prefix = NULL;
  341|       |    const char *suffix = NULL;
  342|       |
  343|       |    for (category = 0; category < OSSL_TRACE_CATEGORY_NUM; category++) {
  344|       |        /* We force the TRACE category to be treated last */
  345|       |        if (category == OSSL_TRACE_CATEGORY_TRACE)
  346|       |            continue;
  347|       |        set_trace_data(category, 0, &channel, &prefix, &suffix,
  348|       |                       trace_attach_cb, trace_detach_cb);
  349|       |    }
  350|       |    set_trace_data(OSSL_TRACE_CATEGORY_TRACE, 0, &channel,
  351|       |                   &prefix, &suffix,
  352|       |                   trace_attach_cb, trace_detach_cb);
  353|       |    CRYPTO_THREAD_lock_free(trace_lock);
  354|       |#endif
  355|      2|}
OSSL_trace_set_channel:
  358|      2|{
  359|       |#ifndef OPENSSL_NO_TRACE
  360|       |    if (category >= 0 && category < OSSL_TRACE_CATEGORY_NUM)
  361|       |        return set_trace_data(category, SIMPLE_CHANNEL, &channel, NULL, NULL,
  362|       |                              trace_attach_cb, trace_detach_cb);
  363|       |#endif
  364|      2|    return 0;
  365|      2|}

ossl_err_load_TS_strings:
   82|      2|{
   83|      2|# ifndef OPENSSL_NO_ERR
   84|      2|    if (ERR_reason_error_string(TS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (84:9): [True: 2, False: 0]
  ------------------
   85|      2|        ERR_load_strings_const(TS_str_reasons);
   86|      2|# endif
   87|      2|    return 1;
   88|      2|}

ossl_err_load_UI_strings:
   41|      2|{
   42|      2|#ifndef OPENSSL_NO_ERR
   43|      2|    if (ERR_reason_error_string(UI_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (43:9): [True: 2, False: 0]
  ------------------
   44|      2|        ERR_load_strings_const(UI_str_reasons);
   45|      2|#endif
   46|      2|    return 1;
   47|      2|}

ossl_err_load_X509V3_strings:
  141|      2|{
  142|      2|#ifndef OPENSSL_NO_ERR
  143|      2|    if (ERR_reason_error_string(X509V3_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (143:9): [True: 2, False: 0]
  ------------------
  144|      2|        ERR_load_strings_const(X509V3_str_reasons);
  145|      2|#endif
  146|      2|    return 1;
  147|      2|}

ossl_err_load_X509_strings:
   90|      2|{
   91|      2|#ifndef OPENSSL_NO_ERR
   92|      2|    if (ERR_reason_error_string(X509_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (92:9): [True: 2, False: 0]
  ------------------
   93|      2|        ERR_load_strings_const(X509_str_reasons);
   94|      2|#endif
   95|      2|    return 1;
   96|      2|}

FuzzerInitialize:
   20|      2|{
   21|      2|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  449|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
   22|      2|    ERR_clear_error();
   23|      2|    return 1;
   24|      2|}
FuzzerTestOneInput:
   27|  3.13k|{
   28|  3.13k|    CONF *conf;
   29|  3.13k|    BIO *in;
   30|  3.13k|    long eline;
   31|       |
   32|  3.13k|    if (len == 0)
  ------------------
  |  Branch (32:9): [True: 0, False: 3.13k]
  ------------------
   33|      0|        return 0;
   34|       |
   35|  3.13k|    conf = NCONF_new(NULL);
   36|  3.13k|    in = BIO_new(BIO_s_mem());
   37|  3.13k|    OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
  ------------------
  |  |  420|  3.13k|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  267|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  268|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (420:12): [True: 3.13k, False: 0]
  |  |  ------------------
  ------------------
   38|  3.13k|    NCONF_load_bio(conf, in, &eline);
   39|  3.13k|    NCONF_free(conf);
   40|  3.13k|    BIO_free(in);
   41|  3.13k|    ERR_clear_error();
   42|       |
   43|  3.13k|    return 0;
   44|  3.13k|}

LLVMFuzzerInitialize:
   22|      2|{
   23|      2|    return FuzzerInitialize(argc, argv);
   24|      2|}
LLVMFuzzerTestOneInput:
   27|  3.13k|{
   28|  3.13k|    return FuzzerTestOneInput(buf, len);
   29|  3.13k|}

bio_print.c:ossl_assert_int:
   36|  3.58M|{
   37|  3.58M|    if (!expr)
  ------------------
  |  Branch (37:9): [True: 0, False: 3.58M]
  ------------------
   38|      0|        OPENSSL_die(exprstr, file, line);
   39|       |
   40|  3.58M|    return expr;
   41|  3.58M|}
conf_def.c:ossl_is_absolute_path:
  248|    196|{
  249|       |# if defined __VMS
  250|       |    if (strchr(path, ':') != NULL
  251|       |        || ((path[0] == '[' || path[0] == '<')
  252|       |            && path[1] != '.' && path[1] != '-'
  253|       |            && path[1] != ']' && path[1] != '>'))
  254|       |        return 1;
  255|       |# elif defined _WIN32
  256|       |    if (path[0] == '\\'
  257|       |        || (path[0] != '\0' && path[1] == ':'))
  258|       |        return 1;
  259|       |# endif
  260|    196|    return path[0] == '/';
  261|    196|}
conf_def.c:ossl_ends_with_dirsep:
  234|    137|{
  235|    137|    if (*path != '\0')
  ------------------
  |  Branch (235:9): [True: 137, False: 0]
  ------------------
  236|    137|        path += strlen(path) - 1;
  237|       |# if defined __VMS
  238|       |    if (*path == ']' || *path == '>' || *path == ':')
  239|       |        return 1;
  240|       |# elif defined _WIN32
  241|       |    if (*path == '\\')
  242|       |        return 1;
  243|       |# endif
  244|    137|    return *path == '/';
  245|    137|}

bio_lib.c:CRYPTO_DOWN_REF:
   49|  3.38k|{
   50|  3.38k|    *ret = atomic_fetch_sub_explicit(val, 1, memory_order_relaxed) - 1;
   51|  3.38k|    if (*ret == 0)
  ------------------
  |  Branch (51:9): [True: 3.38k, False: 0]
  ------------------
   52|  3.38k|        atomic_thread_fence(memory_order_acquire);
   53|  3.38k|    return 1;
   54|  3.38k|}

err.c:do_err_strings_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
err.c:err_do_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_base_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_register_atexit_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_crypto_nodelete_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_crypto_strings_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
initthread.c:create_global_tevent_register_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
conf_mod.c:do_init_module_list_lock_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
context.c:default_context_do_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \

err.c:ERR_GET_LIB:
  242|  8.62k|{
  243|  8.62k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  8.62k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  8.62k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 8.62k]
  |  |  ------------------
  ------------------
  244|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
  245|  8.62k|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  226|  8.62k|# define ERR_LIB_OFFSET                 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  227|  8.62k|# define ERR_LIB_MASK                   0xFF
  ------------------
  246|  8.62k|}
err.c:ERR_GET_REASON:
  256|     68|{
  257|     68|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|     68|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     68|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 68]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|     68|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|     68|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|     68|}

err.c:ossl_check_ERR_STRING_DATA_lh_type:
  149|  8.55k|    { \
  150|  8.55k|        return (OPENSSL_LHASH *)lh; \
  151|  8.55k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_hashfunc_type:
  157|      2|    { \
  158|      2|        return (OPENSSL_LH_HASHFUNC)hfn; \
  159|      2|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_compfunc_type:
  153|      2|    { \
  154|      2|        return (OPENSSL_LH_COMPFUNC)cmp; \
  155|      2|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  137|  8.41k|    { \
  138|  8.41k|        return ptr; \
  139|  8.41k|    } \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  141|    136|    { \
  142|    136|        return ptr; \
  143|    136|    } \
store_register.c:lh_OSSL_STORE_LOADER_free:
  175|      2|    { \
  176|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  177|      2|    } \
conf_api.c:ossl_check_CONF_VALUE_lh_type:
  149|   111k|    { \
  150|   111k|        return (OPENSSL_LHASH *)lh; \
  151|   111k|    } \
conf_api.c:ossl_check_const_CONF_VALUE_lh_plain_type:
  141|  46.7k|    { \
  142|  46.7k|        return ptr; \
  143|  46.7k|    } \
conf_api.c:ossl_check_CONF_VALUE_lh_plain_type:
  137|  41.4k|    { \
  138|  41.4k|        return ptr; \
  139|  41.4k|    } \
conf_api.c:ossl_check_CONF_VALUE_lh_hashfunc_type:
  157|  3.13k|    { \
  158|  3.13k|        return (OPENSSL_LH_HASHFUNC)hfn; \
  159|  3.13k|    } \
conf_api.c:ossl_check_CONF_VALUE_lh_compfunc_type:
  153|  3.13k|    { \
  154|  3.13k|        return (OPENSSL_LH_COMPFUNC)cmp; \
  155|  3.13k|    } \
conf_api.c:lh_CONF_VALUE_doall_LH_CONF_VALUE:
  247|  3.13k|    { \
  248|  3.13k|        OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNCARG)fn, (void *)arg); \
  249|  3.13k|    } \
conf_api.c:ossl_check_CONF_VALUE_lh_doallfunc_type:
  161|  3.13k|    { \
  162|  3.13k|        return (OPENSSL_LH_DOALL_FUNC)dfn; \
  163|  3.13k|    } \
property_string.c:lh_PROPERTY_STRING_new:
  170|      4|    { \
  171|      4|        return (LHASH_OF(type) *) \
  172|      4|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  173|      4|    } \
property_string.c:lh_PROPERTY_STRING_doall:
  224|      4|    { \
  225|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  226|      4|    } \
property_string.c:lh_PROPERTY_STRING_free:
  175|      4|    { \
  176|      4|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  177|      4|    } \
property_string.c:lh_PROPERTY_STRING_retrieve:
  191|     32|    { \
  192|     32|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  193|     32|    } \
property_string.c:lh_PROPERTY_STRING_insert:
  183|     16|    { \
  184|     16|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  185|     16|    } \
property_string.c:lh_PROPERTY_STRING_error:
  195|     16|    { \
  196|     16|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  197|     16|    } \

ex_data.c:sk_EX_CALLBACK_pop_free:
  127|     36|    { \
  128|     36|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|     36|    } \
ex_data.c:sk_EX_CALLBACK_num:
   70|  6.78k|    { \
   71|  6.78k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  6.78k|    } \
ex_data.c:sk_EX_CALLBACK_value:
   74|      6|    { \
   75|      6|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|      6|    } \
ex_data.c:sk_EX_CALLBACK_new_null:
   82|      2|    { \
   83|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|      2|    } \
ex_data.c:sk_EX_CALLBACK_push:
  111|      4|    { \
  112|      4|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|      4|    } \
ex_data.c:sk_EX_CALLBACK_set:
  135|      2|    { \
  136|      2|        return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); \
  137|      2|    } \
ex_data.c:ossl_check_const_void_sk_type:
   44|     38|    { \
   45|     38|        return (const OPENSSL_STACK *)sk; \
   46|     38|    } \
ex_data.c:ossl_check_void_sk_type:
   48|  3.39k|    { \
   49|  3.39k|        return (OPENSSL_STACK *)sk; \
   50|  3.39k|    } \
ex_data.c:ossl_check_void_type:
   40|      6|    { \
   41|      6|        return ptr; \
   42|      6|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_new_null:
   82|      2|    { \
   83|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_free:
   94|      2|    { \
   95|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_push:
  111|      2|    { \
  112|      2|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_num:
   70|      4|    { \
   71|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      4|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_value:
   74|      2|    { \
   75|      2|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_delete:
  102|      2|    { \
  103|      2|        return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
  104|      2|    } \
conf_api.c:ossl_check_CONF_VALUE_sk_type:
   48|  48.6k|    { \
   49|  48.6k|        return (OPENSSL_STACK *)sk; \
   50|  48.6k|    } \
conf_api.c:ossl_check_CONF_VALUE_type:
   40|  34.5k|    { \
   41|  34.5k|        return ptr; \
   42|  34.5k|    } \
conf_api.c:ossl_check_const_CONF_VALUE_sk_type:
   44|  34.1k|    { \
   45|  34.1k|        return (const OPENSSL_STACK *)sk; \
   46|  34.1k|    } \
conf_def.c:ossl_check_BIO_sk_type:
   48|  5.38k|    { \
   49|  5.38k|        return (OPENSSL_STACK *)sk; \
   50|  5.38k|    } \
conf_def.c:ossl_check_BIO_type:
   40|    137|    { \
   41|    137|        return ptr; \
   42|    137|    } \
conf_def.c:ossl_check_const_BIO_sk_type:
   44|  1.20k|    { \
   45|  1.20k|        return (const OPENSSL_STACK *)sk; \
   46|  1.20k|    } \
conf_mod.c:sk_CONF_MODULE_num:
   70|      4|    { \
   71|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      4|    } \
conf_mod.c:sk_CONF_MODULE_free:
   94|      2|    { \
   95|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      2|    } \
conf_mod.c:sk_CONF_IMODULE_num:
   70|      2|    { \
   71|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      2|    } \
conf_mod.c:sk_CONF_IMODULE_free:
   94|      4|    { \
   95|      4|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      4|    } \
obj_xref.c:sk_nid_triple_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
obj_xref.c:sk_nid_triple_free:
   94|      2|    { \
   95|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      2|    } \
evp_pbe.c:sk_EVP_PBE_CTL_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \

ossl_err_load_PROV_strings:
  223|      2|{
  224|      2|#ifndef OPENSSL_NO_ERR
  225|      2|    if (ERR_reason_error_string(PROV_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (225:9): [True: 2, False: 0]
  ------------------
  226|      2|        ERR_load_strings_const(PROV_str_reasons);
  227|      2|#endif
  228|      2|    return 1;
  229|      2|}

