OPENSSL_DIR_read:
   86|   634k|{
   87|   634k|    struct dirent *direntry = NULL;
   88|       |
   89|   634k|    if (ctx == NULL || directory == NULL) {
  ------------------
  |  Branch (89:9): [True: 0, False: 634k]
  |  Branch (89:24): [True: 0, False: 634k]
  ------------------
   90|      0|        errno = EINVAL;
   91|      0|        return 0;
   92|      0|    }
   93|       |
   94|   634k|    errno = 0;
   95|   634k|    if (*ctx == NULL) {
  ------------------
  |  Branch (95:9): [True: 6.95k, False: 627k]
  ------------------
   96|  6.95k|        *ctx = malloc(sizeof(**ctx));
   97|  6.95k|        if (*ctx == NULL) {
  ------------------
  |  Branch (97:13): [True: 0, False: 6.95k]
  ------------------
   98|      0|            errno = ENOMEM;
   99|      0|            return 0;
  100|      0|        }
  101|  6.95k|        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|  6.95k|        (*ctx)->dir = opendir(directory);
  113|  6.95k|        if ((*ctx)->dir == NULL) {
  ------------------
  |  Branch (113:13): [True: 0, False: 6.95k]
  ------------------
  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|  6.95k|    }
  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|   634k|    direntry = readdir((*ctx)->dir);
  130|   634k|    if (direntry == NULL) {
  ------------------
  |  Branch (130:9): [True: 6.93k, False: 627k]
  ------------------
  131|  6.93k|        return 0;
  132|  6.93k|    }
  133|       |
  134|   627k|    OPENSSL_strlcpy((*ctx)->entry_name, direntry->d_name,
  135|   627k|                    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(p[-1]))
  141|       |            p--;
  142|       |        if (p > (*ctx)->entry_name && p[-1] == ';')
  143|       |            p[-1] = '\0';
  144|       |        if (strcasecmp((*ctx)->entry_name, (*ctx)->previous_entry_name) == 0)
  145|       |            goto again;
  146|       |    }
  147|       |#endif
  148|   627k|    return (*ctx)->entry_name;
  149|   634k|}
OPENSSL_DIR_end:
  152|  6.95k|{
  153|  6.95k|    if (ctx != NULL && *ctx != NULL) {
  ------------------
  |  Branch (153:9): [True: 6.95k, False: 0]
  |  Branch (153:24): [True: 6.95k, False: 0]
  ------------------
  154|  6.95k|        int ret = closedir((*ctx)->dir);
  155|       |
  156|  6.95k|        free(*ctx);
  157|  6.95k|        switch (ret) {
  158|  6.95k|        case 0:
  ------------------
  |  Branch (158:9): [True: 6.95k, False: 0]
  ------------------
  159|  6.95k|            return 1;
  160|      0|        case -1:
  ------------------
  |  Branch (160:9): [True: 0, False: 6.95k]
  ------------------
  161|      0|            return 0;
  162|      0|        default:
  ------------------
  |  Branch (162:9): [True: 0, False: 6.95k]
  ------------------
  163|      0|            break;
  164|  6.95k|        }
  165|  6.95k|    }
  166|      0|    errno = EINVAL;
  167|      0|    return 0;
  168|  6.95k|}

ERR_load_ASN1_strings:
  344|      2|{
  345|      2|#ifndef OPENSSL_NO_ERR
  346|      2|    if (ERR_func_error_string(ASN1_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (346:9): [True: 2, False: 0]
  ------------------
  347|      2|        ERR_load_strings_const(ASN1_str_functs);
  348|      2|        ERR_load_strings_const(ASN1_str_reasons);
  349|      2|    }
  350|      2|#endif
  351|      2|    return 1;
  352|      2|}

ERR_load_ASYNC_strings:
   43|      2|{
   44|      2|#ifndef OPENSSL_NO_ERR
   45|      2|    if (ERR_func_error_string(ASYNC_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (45:9): [True: 2, False: 0]
  ------------------
   46|      2|        ERR_load_strings_const(ASYNC_str_functs);
   47|      2|        ERR_load_strings_const(ASYNC_str_reasons);
   48|      2|    }
   49|      2|#endif
   50|      2|    return 1;
   51|      2|}

BIO_snprintf:
  923|    865|{
  924|    865|    va_list args;
  925|    865|    int ret;
  926|       |
  927|    865|    va_start(args, format);
  928|       |
  929|    865|    ret = BIO_vsnprintf(buf, n, format, args);
  930|       |
  931|    865|    va_end(args);
  932|    865|    return ret;
  933|    865|}
BIO_vsnprintf:
  936|    865|{
  937|    865|    size_t retlen;
  938|    865|    int truncated;
  939|       |
  940|    865|    if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
  ------------------
  |  Branch (940:9): [True: 0, False: 865]
  ------------------
  941|      0|        return -1;
  942|       |
  943|    865|    if (truncated)
  ------------------
  |  Branch (943:9): [True: 0, False: 865]
  ------------------
  944|       |        /*
  945|       |         * In case of truncation, return -1 like traditional snprintf.
  946|       |         * (Current drafts for ISO/IEC 9899 say snprintf should return the
  947|       |         * number of characters that would have been written, had the buffer
  948|       |         * been large enough.)
  949|       |         */
  950|      0|        return -1;
  951|    865|    else
  952|    865|        return (retlen <= INT_MAX) ? (int)retlen : -1;
  ------------------
  |  Branch (952:16): [True: 865, False: 0]
  ------------------
  953|    865|}
b_print.c:_dopr:
   91|    865|{
   92|    865|    char ch;
   93|    865|    int64_t value;
   94|    865|#ifndef OPENSSL_SYS_UEFI
   95|    865|    LDOUBLE fvalue;
  ------------------
  |  |   28|    865|# define LDOUBLE double
  ------------------
   96|    865|#endif
   97|    865|    char *strvalue;
   98|    865|    int min;
   99|    865|    int max;
  100|    865|    int state;
  101|    865|    int flags;
  102|    865|    int cflags;
  103|    865|    size_t currlen;
  104|       |
  105|    865|    state = DP_S_DEFAULT;
  ------------------
  |  |   45|    865|#define DP_S_DEFAULT    0
  ------------------
  106|    865|    flags = currlen = cflags = min = 0;
  107|    865|    max = -1;
  108|    865|    ch = *format++;
  109|       |
  110|  6.92k|    while (state != DP_S_DONE) {
  ------------------
  |  |   52|  6.92k|#define DP_S_DONE       7
  ------------------
  |  Branch (110:12): [True: 6.05k, False: 865]
  ------------------
  111|  6.05k|        if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
  ------------------
  |  Branch (111:13): [True: 865, False: 5.19k]
  |  Branch (111:28): [True: 5.19k, False: 0]
  |  Branch (111:46): [True: 0, False: 5.19k]
  ------------------
  112|    865|            state = DP_S_DONE;
  ------------------
  |  |   52|    865|#define DP_S_DONE       7
  ------------------
  113|       |
  114|  6.05k|        switch (state) {
  115|    865|        case DP_S_DEFAULT:
  ------------------
  |  |   45|    865|#define DP_S_DEFAULT    0
  ------------------
  |  Branch (115:9): [True: 865, False: 5.19k]
  ------------------
  116|    865|            if (ch == '%')
  ------------------
  |  Branch (116:17): [True: 865, False: 0]
  ------------------
  117|    865|                state = DP_S_FLAGS;
  ------------------
  |  |   46|    865|#define DP_S_FLAGS      1
  ------------------
  118|      0|            else
  119|      0|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (119:21): [True: 0, False: 0]
  ------------------
  120|      0|                    return 0;
  121|    865|            ch = *format++;
  122|    865|            break;
  123|    865|        case DP_S_FLAGS:
  ------------------
  |  |   46|    865|#define DP_S_FLAGS      1
  ------------------
  |  Branch (123:9): [True: 865, False: 5.19k]
  ------------------
  124|    865|            switch (ch) {
  125|      0|            case '-':
  ------------------
  |  Branch (125:13): [True: 0, False: 865]
  ------------------
  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: 865]
  ------------------
  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: 865]
  ------------------
  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: 865]
  ------------------
  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: 865]
  ------------------
  142|      0|                flags |= DP_F_ZERO;
  ------------------
  |  |   64|      0|#define DP_F_ZERO       (1 << 4)
  ------------------
  143|      0|                ch = *format++;
  144|      0|                break;
  145|    865|            default:
  ------------------
  |  Branch (145:13): [True: 865, False: 0]
  ------------------
  146|    865|                state = DP_S_MIN;
  ------------------
  |  |   47|    865|#define DP_S_MIN        2
  ------------------
  147|    865|                break;
  148|    865|            }
  149|    865|            break;
  150|    865|        case DP_S_MIN:
  ------------------
  |  |   47|    865|#define DP_S_MIN        2
  ------------------
  |  Branch (150:9): [True: 865, False: 5.19k]
  ------------------
  151|    865|            if (ossl_isdigit(ch)) {
  ------------------
  |  |   71|    865|# define ossl_isdigit(c)        (ossl_ctype_check((c), CTYPE_MASK_digit))
  |  |  ------------------
  |  |  |  |   26|    865|# define CTYPE_MASK_digit       0x4
  |  |  ------------------
  |  |  |  Branch (71:33): [True: 0, False: 865]
  |  |  ------------------
  ------------------
  152|      0|                min = 10 * min + char_to_int(ch);
  ------------------
  |  |   83|      0|#define char_to_int(p) (p - '0')
  ------------------
  153|      0|                ch = *format++;
  154|    865|            } else if (ch == '*') {
  ------------------
  |  Branch (154:24): [True: 0, False: 865]
  ------------------
  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|    865|                state = DP_S_DOT;
  ------------------
  |  |   48|    865|#define DP_S_DOT        3
  ------------------
  160|    865|            break;
  161|    865|        case DP_S_DOT:
  ------------------
  |  |   48|    865|#define DP_S_DOT        3
  ------------------
  |  Branch (161:9): [True: 865, False: 5.19k]
  ------------------
  162|    865|            if (ch == '.') {
  ------------------
  |  Branch (162:17): [True: 0, False: 865]
  ------------------
  163|      0|                state = DP_S_MAX;
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  164|      0|                ch = *format++;
  165|      0|            } else
  166|    865|                state = DP_S_MOD;
  ------------------
  |  |   50|    865|#define DP_S_MOD        5
  ------------------
  167|    865|            break;
  168|      0|        case DP_S_MAX:
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  |  Branch (168:9): [True: 0, False: 6.05k]
  ------------------
  169|      0|            if (ossl_isdigit(ch)) {
  ------------------
  |  |   71|      0|# define ossl_isdigit(c)        (ossl_ctype_check((c), CTYPE_MASK_digit))
  |  |  ------------------
  |  |  |  |   26|      0|# define CTYPE_MASK_digit       0x4
  |  |  ------------------
  |  |  |  Branch (71:33): [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|    865|        case DP_S_MOD:
  ------------------
  |  |   50|    865|#define DP_S_MOD        5
  ------------------
  |  Branch (181:9): [True: 865, False: 5.19k]
  ------------------
  182|    865|            switch (ch) {
  183|      0|            case 'h':
  ------------------
  |  Branch (183:13): [True: 0, False: 865]
  ------------------
  184|      0|                cflags = DP_C_SHORT;
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  185|      0|                ch = *format++;
  186|      0|                break;
  187|    865|            case 'l':
  ------------------
  |  Branch (187:13): [True: 865, False: 0]
  ------------------
  188|    865|                if (*format == 'l') {
  ------------------
  |  Branch (188:21): [True: 0, False: 865]
  ------------------
  189|      0|                    cflags = DP_C_LLONG;
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  190|      0|                    format++;
  191|      0|                } else
  192|    865|                    cflags = DP_C_LONG;
  ------------------
  |  |   72|    865|#define DP_C_LONG       2
  ------------------
  193|    865|                ch = *format++;
  194|    865|                break;
  195|      0|            case 'q':
  ------------------
  |  Branch (195:13): [True: 0, False: 865]
  ------------------
  196|      0|            case 'j':
  ------------------
  |  Branch (196:13): [True: 0, False: 865]
  ------------------
  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: 865]
  ------------------
  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: 865]
  ------------------
  205|      0|                cflags = DP_C_SIZE;
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  206|      0|                ch = *format++;
  207|      0|                break;
  208|      0|            default:
  ------------------
  |  Branch (208:13): [True: 0, False: 865]
  ------------------
  209|      0|                break;
  210|    865|            }
  211|    865|            state = DP_S_CONV;
  ------------------
  |  |   51|    865|#define DP_S_CONV       6
  ------------------
  212|    865|            break;
  213|    865|        case DP_S_CONV:
  ------------------
  |  |   51|    865|#define DP_S_CONV       6
  ------------------
  |  Branch (213:9): [True: 865, False: 5.19k]
  ------------------
  214|    865|            switch (ch) {
  215|    865|            case 'd':
  ------------------
  |  Branch (215:13): [True: 865, False: 0]
  ------------------
  216|    865|            case 'i':
  ------------------
  |  Branch (216:13): [True: 0, False: 865]
  ------------------
  217|    865|                switch (cflags) {
  218|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (218:17): [True: 0, False: 865]
  ------------------
  219|      0|                    value = (short int)va_arg(args, int);
  220|      0|                    break;
  221|    865|                case DP_C_LONG:
  ------------------
  |  |   72|    865|#define DP_C_LONG       2
  ------------------
  |  Branch (221:17): [True: 865, False: 0]
  ------------------
  222|    865|                    value = va_arg(args, long int);
  223|    865|                    break;
  224|      0|                case DP_C_LLONG:
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  |  Branch (224:17): [True: 0, False: 865]
  ------------------
  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: 865]
  ------------------
  228|      0|                    value = va_arg(args, ossl_ssize_t);
  229|      0|                    break;
  230|      0|                default:
  ------------------
  |  Branch (230:17): [True: 0, False: 865]
  ------------------
  231|      0|                    value = va_arg(args, int);
  232|      0|                    break;
  233|    865|                }
  234|    865|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min,
  ------------------
  |  Branch (234:21): [True: 0, False: 865]
  ------------------
  235|    865|                            max, flags))
  236|      0|                    return 0;
  237|    865|                break;
  238|    865|            case 'X':
  ------------------
  |  Branch (238:13): [True: 0, False: 865]
  ------------------
  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: 865]
  ------------------
  242|      0|            case 'o':
  ------------------
  |  Branch (242:13): [True: 0, False: 865]
  ------------------
  243|      0|            case 'u':
  ------------------
  |  Branch (243:13): [True: 0, False: 865]
  ------------------
  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: 865]
  ------------------
  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: 865]
  ------------------
  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: 865]
  ------------------
  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: 865]
  ------------------
  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: 865]
  ------------------
  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|       |                return 0;
  309|       |#endif
  310|      0|            case 'c':
  ------------------
  |  Branch (310:13): [True: 0, False: 865]
  ------------------
  311|      0|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
  ------------------
  |  Branch (311:21): [True: 0, False: 0]
  ------------------
  312|      0|                                 va_arg(args, int)))
  313|      0|                    return 0;
  314|      0|                break;
  315|      0|            case 's':
  ------------------
  |  Branch (315:13): [True: 0, False: 865]
  ------------------
  316|      0|                strvalue = va_arg(args, char *);
  317|      0|                if (max < 0) {
  ------------------
  |  Branch (317:21): [True: 0, False: 0]
  ------------------
  318|      0|                    if (buffer)
  ------------------
  |  Branch (318:25): [True: 0, False: 0]
  ------------------
  319|      0|                        max = INT_MAX;
  320|      0|                    else
  321|      0|                        max = *maxlen;
  322|      0|                }
  323|      0|                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
  ------------------
  |  Branch (323:21): [True: 0, False: 0]
  ------------------
  324|      0|                            flags, min, max))
  325|      0|                    return 0;
  326|      0|                break;
  327|      0|            case 'p':
  ------------------
  |  Branch (327:13): [True: 0, False: 865]
  ------------------
  328|      0|                value = (size_t)va_arg(args, void *);
  329|      0|                if (!fmtint(sbuffer, buffer, &currlen, maxlen,
  ------------------
  |  Branch (329:21): [True: 0, False: 0]
  ------------------
  330|      0|                            value, 16, min, max, flags | DP_F_NUM))
  ------------------
  |  |   62|      0|#define DP_F_NUM        (1 << 3)
  ------------------
  331|      0|                    return 0;
  332|      0|                break;
  333|      0|            case 'n':
  ------------------
  |  Branch (333:13): [True: 0, False: 865]
  ------------------
  334|      0|                {
  335|      0|                    int *num;
  336|      0|                    num = va_arg(args, int *);
  337|      0|                    *num = currlen;
  338|      0|                }
  339|      0|                break;
  340|      0|            case '%':
  ------------------
  |  Branch (340:13): [True: 0, False: 865]
  ------------------
  341|      0|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (341:21): [True: 0, False: 0]
  ------------------
  342|      0|                    return 0;
  343|      0|                break;
  344|      0|            case 'w':
  ------------------
  |  Branch (344:13): [True: 0, False: 865]
  ------------------
  345|       |                /* not supported yet, treat as next char */
  346|      0|                ch = *format++;
  347|      0|                break;
  348|      0|            default:
  ------------------
  |  Branch (348:13): [True: 0, False: 865]
  ------------------
  349|       |                /* unknown, skip */
  350|      0|                break;
  351|    865|            }
  352|    865|            ch = *format++;
  353|    865|            state = DP_S_DEFAULT;
  ------------------
  |  |   45|    865|#define DP_S_DEFAULT    0
  ------------------
  354|    865|            flags = cflags = min = 0;
  355|    865|            max = -1;
  356|    865|            break;
  357|    865|        case DP_S_DONE:
  ------------------
  |  |   52|    865|#define DP_S_DONE       7
  ------------------
  |  Branch (357:9): [True: 865, False: 5.19k]
  ------------------
  358|    865|            break;
  359|      0|        default:
  ------------------
  |  Branch (359:9): [True: 0, False: 6.05k]
  ------------------
  360|      0|            break;
  361|  6.05k|        }
  362|  6.05k|    }
  363|       |    /*
  364|       |     * We have to truncate if there is no dynamic buffer and we have filled the
  365|       |     * static buffer.
  366|       |     */
  367|    865|    if (buffer == NULL) {
  ------------------
  |  Branch (367:9): [True: 865, False: 0]
  ------------------
  368|    865|        *truncated = (currlen > *maxlen - 1);
  369|    865|        if (*truncated)
  ------------------
  |  Branch (369:13): [True: 0, False: 865]
  ------------------
  370|      0|            currlen = *maxlen - 1;
  371|    865|    }
  372|    865|    if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
  ------------------
  |  Branch (372:9): [True: 0, False: 865]
  ------------------
  373|      0|        return 0;
  374|    865|    *retlen = currlen - 1;
  375|    865|    return 1;
  376|    865|}
b_print.c:doapr_outch:
  830|  2.08k|{
  831|       |    /* If we haven't at least one buffer, someone has done a big booboo */
  832|  2.08k|    if (!ossl_assert(*sbuffer != NULL || buffer != NULL))
  ------------------
  |  |   40|  2.08k|# define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (40:42): [True: 2.08k, False: 0]
  |  |  |  Branch (40:42): [True: 0, False: 0]
  |  |  ------------------
  |  |   41|  2.08k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (832:9): [True: 0, False: 2.08k]
  ------------------
  833|      0|        return 0;
  834|       |
  835|       |    /* |currlen| must always be <= |*maxlen| */
  836|  2.08k|    if (!ossl_assert(*currlen <= *maxlen))
  ------------------
  |  |   40|  2.08k|# define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   41|  2.08k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (836:9): [True: 0, False: 2.08k]
  ------------------
  837|      0|        return 0;
  838|       |
  839|  2.08k|    if (buffer && *currlen == *maxlen) {
  ------------------
  |  Branch (839:9): [True: 0, False: 2.08k]
  |  Branch (839:19): [True: 0, False: 0]
  ------------------
  840|      0|        if (*maxlen > INT_MAX - BUFFER_INC)
  ------------------
  |  |  825|      0|#define BUFFER_INC  1024
  ------------------
  |  Branch (840:13): [True: 0, False: 0]
  ------------------
  841|      0|            return 0;
  842|       |
  843|      0|        *maxlen += BUFFER_INC;
  ------------------
  |  |  825|      0|#define BUFFER_INC  1024
  ------------------
  844|      0|        if (*buffer == NULL) {
  ------------------
  |  Branch (844:13): [True: 0, False: 0]
  ------------------
  845|      0|            if ((*buffer = OPENSSL_malloc(*maxlen)) == NULL) {
  ------------------
  |  |  118|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (845:17): [True: 0, False: 0]
  ------------------
  846|      0|                BIOerr(BIO_F_DOAPR_OUTCH, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  847|      0|                return 0;
  848|      0|            }
  849|      0|            if (*currlen > 0) {
  ------------------
  |  Branch (849:17): [True: 0, False: 0]
  ------------------
  850|      0|                if (!ossl_assert(*sbuffer != NULL))
  ------------------
  |  |   40|      0|# define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   41|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (850:21): [True: 0, False: 0]
  ------------------
  851|      0|                    return 0;
  852|      0|                memcpy(*buffer, *sbuffer, *currlen);
  853|      0|            }
  854|      0|            *sbuffer = NULL;
  855|      0|        } else {
  856|      0|            char *tmpbuf;
  857|      0|            tmpbuf = OPENSSL_realloc(*buffer, *maxlen);
  ------------------
  |  |  122|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  858|      0|            if (tmpbuf == NULL)
  ------------------
  |  Branch (858:17): [True: 0, False: 0]
  ------------------
  859|      0|                return 0;
  860|      0|            *buffer = tmpbuf;
  861|      0|        }
  862|      0|    }
  863|       |
  864|  2.08k|    if (*currlen < *maxlen) {
  ------------------
  |  Branch (864:9): [True: 2.08k, False: 0]
  ------------------
  865|  2.08k|        if (*sbuffer)
  ------------------
  |  Branch (865:13): [True: 2.08k, False: 0]
  ------------------
  866|  2.08k|            (*sbuffer)[(*currlen)++] = (char)c;
  867|      0|        else
  868|      0|            (*buffer)[(*currlen)++] = (char)c;
  869|  2.08k|    }
  870|       |
  871|  2.08k|    return 1;
  872|  2.08k|}
b_print.c:fmtint:
  435|    865|{
  436|    865|    int signvalue = 0;
  437|    865|    const char *prefix = "";
  438|    865|    uint64_t uvalue;
  439|    865|    char convert[DECIMAL_SIZE(value) + 3];
  440|    865|    int place = 0;
  441|    865|    int spadlen = 0;
  442|    865|    int zpadlen = 0;
  443|    865|    int caps = 0;
  444|       |
  445|    865|    if (max < 0)
  ------------------
  |  Branch (445:9): [True: 865, False: 0]
  ------------------
  446|    865|        max = 0;
  447|    865|    uvalue = value;
  448|    865|    if (!(flags & DP_F_UNSIGNED)) {
  ------------------
  |  |   68|    865|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  |  Branch (448:9): [True: 865, False: 0]
  ------------------
  449|    865|        if (value < 0) {
  ------------------
  |  Branch (449:13): [True: 0, False: 865]
  ------------------
  450|      0|            signvalue = '-';
  451|      0|            uvalue = 0 - (uint64_t)value;
  452|    865|        } else if (flags & DP_F_PLUS)
  ------------------
  |  |   58|    865|#define DP_F_PLUS       (1 << 1)
  ------------------
  |  Branch (452:20): [True: 0, False: 865]
  ------------------
  453|      0|            signvalue = '+';
  454|    865|        else if (flags & DP_F_SPACE)
  ------------------
  |  |   60|    865|#define DP_F_SPACE      (1 << 2)
  ------------------
  |  Branch (454:18): [True: 0, False: 865]
  ------------------
  455|      0|            signvalue = ' ';
  456|    865|    }
  457|    865|    if (flags & DP_F_NUM) {
  ------------------
  |  |   62|    865|#define DP_F_NUM        (1 << 3)
  ------------------
  |  Branch (457:9): [True: 0, False: 865]
  ------------------
  458|      0|        if (base == 8)
  ------------------
  |  Branch (458:13): [True: 0, False: 0]
  ------------------
  459|      0|            prefix = "0";
  460|      0|        if (base == 16)
  ------------------
  |  Branch (460:13): [True: 0, False: 0]
  ------------------
  461|      0|            prefix = "0x";
  462|      0|    }
  463|    865|    if (flags & DP_F_UP)
  ------------------
  |  |   66|    865|#define DP_F_UP         (1 << 5)
  ------------------
  |  Branch (463:9): [True: 0, False: 865]
  ------------------
  464|      0|        caps = 1;
  465|  1.21k|    do {
  466|  1.21k|        convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
  ------------------
  |  Branch (466:29): [True: 0, False: 1.21k]
  ------------------
  467|  1.21k|            [uvalue % (unsigned)base];
  468|  1.21k|        uvalue = (uvalue / (unsigned)base);
  469|  1.21k|    } while (uvalue && (place < (int)sizeof(convert)));
  ------------------
  |  Branch (469:14): [True: 350, False: 865]
  |  Branch (469:24): [True: 350, False: 0]
  ------------------
  470|    865|    if (place == sizeof(convert))
  ------------------
  |  Branch (470:9): [True: 0, False: 865]
  ------------------
  471|      0|        place--;
  472|    865|    convert[place] = 0;
  473|       |
  474|    865|    zpadlen = max - place;
  475|    865|    spadlen =
  476|    865|        min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - strlen(prefix);
  ------------------
  |  |   84|    865|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 865]
  |  |  ------------------
  ------------------
  |  Branch (476:39): [True: 0, False: 865]
  ------------------
  477|    865|    if (zpadlen < 0)
  ------------------
  |  Branch (477:9): [True: 865, False: 0]
  ------------------
  478|    865|        zpadlen = 0;
  479|    865|    if (spadlen < 0)
  ------------------
  |  Branch (479:9): [True: 865, False: 0]
  ------------------
  480|    865|        spadlen = 0;
  481|    865|    if (flags & DP_F_ZERO) {
  ------------------
  |  |   64|    865|#define DP_F_ZERO       (1 << 4)
  ------------------
  |  Branch (481:9): [True: 0, False: 865]
  ------------------
  482|      0|        zpadlen = OSSL_MAX(zpadlen, spadlen);
  ------------------
  |  |   84|      0|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  483|      0|        spadlen = 0;
  484|      0|    }
  485|    865|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|    865|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (485:9): [True: 0, False: 865]
  ------------------
  486|      0|        spadlen = -spadlen;
  487|       |
  488|       |    /* spaces */
  489|    865|    while (spadlen > 0) {
  ------------------
  |  Branch (489:12): [True: 0, False: 865]
  ------------------
  490|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (490:13): [True: 0, False: 0]
  ------------------
  491|      0|            return 0;
  492|      0|        --spadlen;
  493|      0|    }
  494|       |
  495|       |    /* sign */
  496|    865|    if (signvalue)
  ------------------
  |  Branch (496:9): [True: 0, False: 865]
  ------------------
  497|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
  ------------------
  |  Branch (497:13): [True: 0, False: 0]
  ------------------
  498|      0|            return 0;
  499|       |
  500|       |    /* prefix */
  501|    865|    while (*prefix) {
  ------------------
  |  Branch (501:12): [True: 0, False: 865]
  ------------------
  502|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix))
  ------------------
  |  Branch (502:13): [True: 0, False: 0]
  ------------------
  503|      0|            return 0;
  504|      0|        prefix++;
  505|      0|    }
  506|       |
  507|       |    /* zeros */
  508|    865|    if (zpadlen > 0) {
  ------------------
  |  Branch (508:9): [True: 0, False: 865]
  ------------------
  509|      0|        while (zpadlen > 0) {
  ------------------
  |  Branch (509:16): [True: 0, False: 0]
  ------------------
  510|      0|            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
  ------------------
  |  Branch (510:17): [True: 0, False: 0]
  ------------------
  511|      0|                return 0;
  512|      0|            --zpadlen;
  513|      0|        }
  514|      0|    }
  515|       |    /* digits */
  516|  2.08k|    while (place > 0) {
  ------------------
  |  Branch (516:12): [True: 1.21k, False: 865]
  ------------------
  517|  1.21k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]))
  ------------------
  |  Branch (517:13): [True: 0, False: 1.21k]
  ------------------
  518|      0|            return 0;
  519|  1.21k|    }
  520|       |
  521|       |    /* left justified spaces */
  522|    865|    while (spadlen < 0) {
  ------------------
  |  Branch (522:12): [True: 0, False: 865]
  ------------------
  523|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (523:13): [True: 0, False: 0]
  ------------------
  524|      0|            return 0;
  525|      0|        ++spadlen;
  526|      0|    }
  527|    865|    return 1;
  528|    865|}

bio_sock_cleanup_int:
  152|      2|{
  153|       |# ifdef OPENSSL_SYS_WINDOWS
  154|       |    if (wsa_init_done) {
  155|       |        wsa_init_done = 0;
  156|       |        WSACleanup();
  157|       |    }
  158|       |# endif
  159|      2|}

ERR_load_BIO_strings:
  137|      2|{
  138|      2|#ifndef OPENSSL_NO_ERR
  139|      2|    if (ERR_func_error_string(BIO_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (139:9): [True: 2, False: 0]
  ------------------
  140|      2|        ERR_load_strings_const(BIO_str_functs);
  141|      2|        ERR_load_strings_const(BIO_str_reasons);
  142|      2|    }
  143|      2|#endif
  144|      2|    return 1;
  145|      2|}

BIO_new:
   72|  15.4k|{
   73|  15.4k|    BIO *bio = OPENSSL_zalloc(sizeof(*bio));
  ------------------
  |  |  120|  15.4k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  15.4k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  15.4k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|       |
   75|  15.4k|    if (bio == NULL) {
  ------------------
  |  Branch (75:9): [True: 0, False: 15.4k]
  ------------------
   76|      0|        BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
   77|      0|        return NULL;
   78|      0|    }
   79|       |
   80|  15.4k|    bio->method = method;
   81|  15.4k|    bio->shutdown = 1;
   82|  15.4k|    bio->references = 1;
   83|       |
   84|  15.4k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data))
  ------------------
  |  |  106|  15.4k|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  |  Branch (84:9): [True: 0, False: 15.4k]
  ------------------
   85|      0|        goto err;
   86|       |
   87|  15.4k|    bio->lock = CRYPTO_THREAD_lock_new();
   88|  15.4k|    if (bio->lock == NULL) {
  ------------------
  |  Branch (88:9): [True: 0, False: 15.4k]
  ------------------
   89|      0|        BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
   90|      0|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
  ------------------
  |  |  106|      0|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
   91|      0|        goto err;
   92|      0|    }
   93|       |
   94|  15.4k|    if (method->create != NULL && !method->create(bio)) {
  ------------------
  |  Branch (94:9): [True: 15.4k, False: 0]
  |  Branch (94:35): [True: 0, False: 15.4k]
  ------------------
   95|      0|        BIOerr(BIO_F_BIO_NEW, ERR_R_INIT_FAIL);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
   96|      0|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
  ------------------
  |  |  106|      0|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
   97|      0|        CRYPTO_THREAD_lock_free(bio->lock);
   98|      0|        goto err;
   99|      0|    }
  100|  15.4k|    if (method->create == NULL)
  ------------------
  |  Branch (100:9): [True: 0, False: 15.4k]
  ------------------
  101|      0|        bio->init = 1;
  102|       |
  103|  15.4k|    return bio;
  104|       |
  105|      0|err:
  106|      0|    OPENSSL_free(bio);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  107|      0|    return NULL;
  108|  15.4k|}
BIO_free:
  111|  15.4k|{
  112|  15.4k|    int ret;
  113|       |
  114|  15.4k|    if (a == NULL)
  ------------------
  |  Branch (114:9): [True: 0, False: 15.4k]
  ------------------
  115|      0|        return 0;
  116|       |
  117|  15.4k|    if (CRYPTO_DOWN_REF(&a->references, &ret, a->lock) <= 0)
  ------------------
  |  Branch (117:9): [True: 0, False: 15.4k]
  ------------------
  118|      0|        return 0;
  119|       |
  120|  15.4k|    REF_PRINT_COUNT("BIO", a);
  121|  15.4k|    if (ret > 0)
  ------------------
  |  Branch (121:9): [True: 0, False: 15.4k]
  ------------------
  122|      0|        return 1;
  123|  15.4k|    REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  138|  15.4k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (138:12): [True: 0, False: 15.4k]
  |  |  ------------------
  ------------------
  124|       |
  125|  15.4k|    if (a->callback != NULL || a->callback_ex != NULL) {
  ------------------
  |  Branch (125:9): [True: 0, False: 15.4k]
  |  Branch (125:32): [True: 0, False: 15.4k]
  ------------------
  126|      0|        ret = (int)bio_call_callback(a, BIO_CB_FREE, NULL, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  220|      0|# define BIO_CB_FREE     0x01
  ------------------
  127|      0|        if (ret <= 0)
  ------------------
  |  Branch (127:13): [True: 0, False: 0]
  ------------------
  128|      0|            return ret;
  129|      0|    }
  130|       |
  131|  15.4k|    if ((a->method != NULL) && (a->method->destroy != NULL))
  ------------------
  |  Branch (131:9): [True: 15.4k, False: 0]
  |  Branch (131:32): [True: 15.4k, False: 0]
  ------------------
  132|  15.4k|        a->method->destroy(a);
  133|       |
  134|  15.4k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
  ------------------
  |  |  106|  15.4k|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  135|       |
  136|  15.4k|    CRYPTO_THREAD_lock_free(a->lock);
  137|       |
  138|  15.4k|    OPENSSL_free(a);
  ------------------
  |  |  128|  15.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  15.4k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  15.4k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  139|       |
  140|  15.4k|    return 1;
  141|  15.4k|}
BIO_vfree:
  174|  12.9k|{
  175|  12.9k|    BIO_free(a);
  176|  12.9k|}
BIO_clear_flags:
  191|  14.9M|{
  192|  14.9M|    b->flags &= ~flags;
  193|  14.9M|}
BIO_write:
  356|  2.49k|{
  357|  2.49k|    size_t written;
  358|  2.49k|    int ret;
  359|       |
  360|  2.49k|    if (dlen < 0)
  ------------------
  |  Branch (360:9): [True: 0, False: 2.49k]
  ------------------
  361|      0|        return 0;
  362|       |
  363|  2.49k|    ret = bio_write_intern(b, data, (size_t)dlen, &written);
  364|       |
  365|  2.49k|    if (ret > 0) {
  ------------------
  |  Branch (365:9): [True: 2.49k, False: 0]
  ------------------
  366|       |        /* *written should always be <= dlen */
  367|  2.49k|        ret = (int)written;
  368|  2.49k|    }
  369|       |
  370|  2.49k|    return ret;
  371|  2.49k|}
BIO_gets:
  433|  8.00M|{
  434|  8.00M|    int ret;
  435|  8.00M|    size_t readbytes = 0;
  436|       |
  437|  8.00M|    if ((b == NULL) || (b->method == NULL) || (b->method->bgets == NULL)) {
  ------------------
  |  Branch (437:9): [True: 0, False: 8.00M]
  |  Branch (437:24): [True: 0, False: 8.00M]
  |  Branch (437:47): [True: 0, False: 8.00M]
  ------------------
  438|      0|        BIOerr(BIO_F_BIO_GETS, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  439|      0|        return -2;
  440|      0|    }
  441|       |
  442|  8.00M|    if (size < 0) {
  ------------------
  |  Branch (442:9): [True: 0, False: 8.00M]
  ------------------
  443|      0|        BIOerr(BIO_F_BIO_GETS, BIO_R_INVALID_ARGUMENT);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  444|      0|        return 0;
  445|      0|    }
  446|       |
  447|  8.00M|    if (b->callback != NULL || b->callback_ex != NULL) {
  ------------------
  |  Branch (447:9): [True: 0, False: 8.00M]
  |  Branch (447:32): [True: 0, False: 8.00M]
  ------------------
  448|      0|        ret = (int)bio_call_callback(b, BIO_CB_GETS, buf, size, 0, 0L, 1, NULL);
  ------------------
  |  |  224|      0|# define BIO_CB_GETS     0x05
  ------------------
  449|      0|        if (ret <= 0)
  ------------------
  |  Branch (449:13): [True: 0, False: 0]
  ------------------
  450|      0|            return ret;
  451|      0|    }
  452|       |
  453|  8.00M|    if (!b->init) {
  ------------------
  |  Branch (453:9): [True: 0, False: 8.00M]
  ------------------
  454|      0|        BIOerr(BIO_F_BIO_GETS, BIO_R_UNINITIALIZED);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  455|      0|        return -2;
  456|      0|    }
  457|       |
  458|  8.00M|    ret = b->method->bgets(b, buf, size);
  459|       |
  460|  8.00M|    if (ret > 0) {
  ------------------
  |  Branch (460:9): [True: 7.99M, False: 16.8k]
  ------------------
  461|  7.99M|        readbytes = ret;
  462|  7.99M|        ret = 1;
  463|  7.99M|    }
  464|       |
  465|  8.00M|    if (b->callback != NULL || b->callback_ex != NULL)
  ------------------
  |  Branch (465:9): [True: 0, False: 8.00M]
  |  Branch (465:32): [True: 0, False: 8.00M]
  ------------------
  466|      0|        ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
  ------------------
  |  |  224|      0|# define BIO_CB_GETS     0x05
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
  ------------------
  |  |  231|      0|# define BIO_CB_RETURN   0x80
  ------------------
  467|      0|                                     0, 0L, ret, &readbytes);
  468|       |
  469|  8.00M|    if (ret > 0) {
  ------------------
  |  Branch (469:9): [True: 7.99M, False: 16.8k]
  ------------------
  470|       |        /* Shouldn't happen */
  471|  7.99M|        if (readbytes > (size_t)size)
  ------------------
  |  Branch (471:13): [True: 0, False: 7.99M]
  ------------------
  472|      0|            ret = -1;
  473|  7.99M|        else
  474|  7.99M|            ret = (int)readbytes;
  475|  7.99M|    }
  476|       |
  477|  8.00M|    return ret;
  478|  8.00M|}
BIO_ctrl:
  511|  12.9k|{
  512|  12.9k|    long ret;
  513|       |
  514|  12.9k|    if (b == NULL)
  ------------------
  |  Branch (514:9): [True: 0, False: 12.9k]
  ------------------
  515|      0|        return 0;
  516|       |
  517|  12.9k|    if ((b->method == NULL) || (b->method->ctrl == NULL)) {
  ------------------
  |  Branch (517:9): [True: 0, False: 12.9k]
  |  Branch (517:32): [True: 0, False: 12.9k]
  ------------------
  518|      0|        BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  519|      0|        return -2;
  520|      0|    }
  521|       |
  522|  12.9k|    if (b->callback != NULL || b->callback_ex != NULL) {
  ------------------
  |  Branch (522:9): [True: 0, False: 12.9k]
  |  Branch (522:32): [True: 0, False: 12.9k]
  ------------------
  523|      0|        ret = bio_call_callback(b, BIO_CB_CTRL, parg, 0, cmd, larg, 1L, NULL);
  ------------------
  |  |  225|      0|# define BIO_CB_CTRL     0x06
  ------------------
  524|      0|        if (ret <= 0)
  ------------------
  |  Branch (524:13): [True: 0, False: 0]
  ------------------
  525|      0|            return ret;
  526|      0|    }
  527|       |
  528|  12.9k|    ret = b->method->ctrl(b, cmd, larg, parg);
  529|       |
  530|  12.9k|    if (b->callback != NULL || b->callback_ex != NULL)
  ------------------
  |  Branch (530:9): [True: 0, False: 12.9k]
  |  Branch (530:32): [True: 0, False: 12.9k]
  ------------------
  531|      0|        ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  225|      0|# define BIO_CB_CTRL     0x06
  ------------------
                      ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  231|      0|# define BIO_CB_RETURN   0x80
  ------------------
  532|      0|                                larg, ret, NULL);
  533|       |
  534|  12.9k|    return ret;
  535|  12.9k|}
bio_cleanup:
  778|      2|{
  779|      2|#ifndef OPENSSL_NO_SOCK
  780|      2|    bio_sock_cleanup_int();
  781|      2|    CRYPTO_THREAD_lock_free(bio_lookup_lock);
  782|      2|    bio_lookup_lock = NULL;
  783|      2|#endif
  784|      2|    CRYPTO_THREAD_lock_free(bio_type_lock);
  785|      2|    bio_type_lock = NULL;
  786|      2|}
bio_lib.c:bio_write_intern:
  322|  2.49k|{
  323|  2.49k|    int ret;
  324|       |
  325|  2.49k|    if (b == NULL)
  ------------------
  |  Branch (325:9): [True: 0, False: 2.49k]
  ------------------
  326|      0|        return 0;
  327|       |
  328|  2.49k|    if ((b->method == NULL) || (b->method->bwrite == NULL)) {
  ------------------
  |  Branch (328:9): [True: 0, False: 2.49k]
  |  Branch (328:32): [True: 0, False: 2.49k]
  ------------------
  329|      0|        BIOerr(BIO_F_BIO_WRITE_INTERN, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  330|      0|        return -2;
  331|      0|    }
  332|       |
  333|  2.49k|    if ((b->callback != NULL || b->callback_ex != NULL) &&
  ------------------
  |  Branch (333:10): [True: 0, False: 2.49k]
  |  Branch (333:33): [True: 0, False: 2.49k]
  ------------------
  334|  2.49k|        ((ret = (int)bio_call_callback(b, BIO_CB_WRITE, data, dlen, 0, 0L, 1L,
  ------------------
  |  |  222|      0|# define BIO_CB_WRITE    0x03
  ------------------
  |  Branch (334:9): [True: 0, False: 0]
  ------------------
  335|      0|                                       NULL)) <= 0))
  336|      0|        return ret;
  337|       |
  338|  2.49k|    if (!b->init) {
  ------------------
  |  Branch (338:9): [True: 0, False: 2.49k]
  ------------------
  339|      0|        BIOerr(BIO_F_BIO_WRITE_INTERN, BIO_R_UNINITIALIZED);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  340|      0|        return -2;
  341|      0|    }
  342|       |
  343|  2.49k|    ret = b->method->bwrite(b, data, dlen, written);
  344|       |
  345|  2.49k|    if (ret > 0)
  ------------------
  |  Branch (345:9): [True: 2.49k, False: 0]
  ------------------
  346|  2.49k|        b->num_write += (uint64_t)*written;
  347|       |
  348|  2.49k|    if (b->callback != NULL || b->callback_ex != NULL)
  ------------------
  |  Branch (348:9): [True: 0, False: 2.49k]
  |  Branch (348:32): [True: 0, False: 2.49k]
  ------------------
  349|      0|        ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  222|      0|# define BIO_CB_WRITE    0x03
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  231|      0|# define BIO_CB_RETURN   0x80
  ------------------
  350|      0|                                     dlen, 0, 0L, ret, written);
  351|       |
  352|  2.49k|    return ret;
  353|  2.49k|}

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

BIO_new_file:
   60|  97.2k|{
   61|  97.2k|    BIO  *ret;
   62|  97.2k|    FILE *file = openssl_fopen(filename, mode);
   63|  97.2k|    int fp_flags = BIO_CLOSE;
  ------------------
  |  |   66|  97.2k|# define BIO_CLOSE               0x01
  ------------------
   64|       |
   65|  97.2k|    if (strchr(mode, 'b') == NULL)
  ------------------
  |  Branch (65:9): [True: 97.2k, False: 0]
  ------------------
   66|  97.2k|        fp_flags |= BIO_FP_TEXT;
  ------------------
  |  |  148|  97.2k|# define BIO_FP_TEXT             0x10
  ------------------
   67|       |
   68|  97.2k|    if (file == NULL) {
  ------------------
  |  Branch (68:9): [True: 84.3k, False: 12.9k]
  ------------------
   69|  84.3k|        SYSerr(SYS_F_FOPEN, get_last_sys_error());
  ------------------
  |  |  101|  84.3k|# define SYSerr(f,r)  ERR_PUT_error(ERR_LIB_SYS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|  84.3k|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
   70|  84.3k|        ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");
   71|  84.3k|        if (errno == ENOENT
  ------------------
  |  Branch (71:13): [True: 0, False: 84.3k]
  ------------------
   72|  84.3k|#ifdef ENXIO
   73|  84.3k|            || errno == ENXIO
  ------------------
  |  Branch (73:16): [True: 0, False: 84.3k]
  ------------------
   74|  84.3k|#endif
   75|  84.3k|            )
   76|  84.3k|            BIOerr(BIO_F_BIO_NEW_FILE, BIO_R_NO_SUCH_FILE);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
   77|  84.3k|        else
   78|  84.3k|            BIOerr(BIO_F_BIO_NEW_FILE, ERR_R_SYS_LIB);
  ------------------
  |  |  116|  84.3k|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|  84.3k|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
   79|  84.3k|        return NULL;
   80|  84.3k|    }
   81|  12.9k|    if ((ret = BIO_new(BIO_s_file())) == NULL) {
  ------------------
  |  Branch (81:9): [True: 0, False: 12.9k]
  ------------------
   82|      0|        fclose(file);
   83|      0|        return NULL;
   84|      0|    }
   85|       |
   86|  12.9k|    BIO_clear_flags(ret, BIO_FLAGS_UPLINK); /* we did fopen -> we disengage
  ------------------
  |  |  160|  12.9k|#  define BIO_FLAGS_UPLINK        0
  ------------------
   87|       |                                             * UPLINK */
   88|  12.9k|    BIO_set_fp(ret, file, fp_flags);
  ------------------
  |  |  416|  12.9k|# define BIO_set_fp(b,fp,c)      BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)(fp))
  |  |  ------------------
  |  |  |  |  299|  12.9k|# define BIO_C_SET_FILE_PTR                      106
  |  |  ------------------
  ------------------
   89|  12.9k|    return ret;
   90|  12.9k|}
BIO_s_file:
  106|  12.9k|{
  107|  12.9k|    return &methods_filep;
  108|  12.9k|}
bss_file.c:file_gets:
  338|   529k|{
  339|   529k|    int ret = 0;
  340|       |
  341|   529k|    buf[0] = '\0';
  342|   529k|    if (bp->flags & BIO_FLAGS_UPLINK) {
  ------------------
  |  |  160|   529k|#  define BIO_FLAGS_UPLINK        0
  ------------------
  |  Branch (342:9): [True: 0, False: 529k]
  ------------------
  343|      0|        if (!UP_fgets(buf, size, bp->ptr))
  ------------------
  |  |  161|      0|# define UP_fgets        fgets
  ------------------
  |  Branch (343:13): [True: 0, False: 0]
  ------------------
  344|      0|            goto err;
  345|   529k|    } else {
  346|   529k|        if (!fgets(buf, size, (FILE *)bp->ptr))
  ------------------
  |  Branch (346:13): [True: 12.8k, False: 516k]
  ------------------
  347|  12.8k|            goto err;
  348|   529k|    }
  349|   516k|    if (buf[0] != '\0')
  ------------------
  |  Branch (349:9): [True: 516k, False: 5]
  ------------------
  350|   516k|        ret = strlen(buf);
  351|   529k| err:
  352|   529k|    return ret;
  353|   516k|}
bss_file.c:file_ctrl:
  179|  12.9k|{
  180|  12.9k|    long ret = 1;
  181|  12.9k|    FILE *fp = (FILE *)b->ptr;
  182|  12.9k|    FILE **fpp;
  183|  12.9k|    char p[4];
  184|  12.9k|    int st;
  185|       |
  186|  12.9k|    switch (cmd) {
  187|      0|    case BIO_C_FILE_SEEK:
  ------------------
  |  |  321|      0|# define BIO_C_FILE_SEEK                         128
  ------------------
  |  Branch (187:5): [True: 0, False: 12.9k]
  ------------------
  188|      0|    case BIO_CTRL_RESET:
  ------------------
  |  |   71|      0|# define BIO_CTRL_RESET          1/* opt - rewind/zero etc */
  ------------------
  |  Branch (188:5): [True: 0, False: 12.9k]
  ------------------
  189|      0|        if (b->flags & BIO_FLAGS_UPLINK)
  ------------------
  |  |  160|      0|#  define BIO_FLAGS_UPLINK        0
  ------------------
  |  Branch (189:13): [True: 0, False: 0]
  ------------------
  190|      0|            ret = (long)UP_fseek(b->ptr, num, 0);
  ------------------
  |  |  169|      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:
  ------------------
  |  |   72|      0|# define BIO_CTRL_EOF            2/* opt - are we at the eof */
  ------------------
  |  Branch (194:5): [True: 0, False: 12.9k]
  ------------------
  195|      0|        if (b->flags & BIO_FLAGS_UPLINK)
  ------------------
  |  |  160|      0|#  define BIO_FLAGS_UPLINK        0
  ------------------
  |  Branch (195:13): [True: 0, False: 0]
  ------------------
  196|      0|            ret = (long)UP_feof(fp);
  ------------------
  |  |  165|      0|# define UP_feof         feof
  ------------------
  197|      0|        else
  198|      0|            ret = (long)feof(fp);
  199|      0|        break;
  200|      0|    case BIO_C_FILE_TELL:
  ------------------
  |  |  327|      0|# define BIO_C_FILE_TELL                         133
  ------------------
  |  Branch (200:5): [True: 0, False: 12.9k]
  ------------------
  201|      0|    case BIO_CTRL_INFO:
  ------------------
  |  |   73|      0|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  ------------------
  |  Branch (201:5): [True: 0, False: 12.9k]
  ------------------
  202|      0|        if (b->flags & BIO_FLAGS_UPLINK)
  ------------------
  |  |  160|      0|#  define BIO_FLAGS_UPLINK        0
  ------------------
  |  Branch (202:13): [True: 0, False: 0]
  ------------------
  203|      0|            ret = UP_ftell(b->ptr);
  ------------------
  |  |  170|      0|# define UP_ftell        ftell
  ------------------
  204|      0|        else
  205|      0|            ret = ftell(fp);
  206|      0|        break;
  207|  12.9k|    case BIO_C_SET_FILE_PTR:
  ------------------
  |  |  299|  12.9k|# define BIO_C_SET_FILE_PTR                      106
  ------------------
  |  Branch (207:5): [True: 12.9k, False: 0]
  ------------------
  208|  12.9k|        file_free(b);
  209|  12.9k|        b->shutdown = (int)num & BIO_CLOSE;
  ------------------
  |  |   66|  12.9k|# define BIO_CLOSE               0x01
  ------------------
  210|  12.9k|        b->ptr = ptr;
  211|  12.9k|        b->init = 1;
  212|       |# if BIO_FLAGS_UPLINK!=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
  218|       |        if (ptr == stdin || ptr == stdout || ptr == stderr)
  219|       |            BIO_clear_flags(b, BIO_FLAGS_UPLINK);
  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);
  224|       |#  endif
  225|       |# endif
  226|       |# ifdef UP_fsetmod
  227|       |        if (b->flags & BIO_FLAGS_UPLINK)
  228|       |            UP_fsetmod(b->ptr, (char)((num & BIO_FP_TEXT) ? 't' : 'b'));
  229|       |        else
  230|       |# endif
  231|  12.9k|        {
  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|       |# elif defined(OPENSSL_SYS_MSDOS)
  239|       |            int fd = fileno((FILE *)ptr);
  240|       |            /* Set correct text/binary mode */
  241|       |            if (num & BIO_FP_TEXT)
  242|       |                _setmode(fd, _O_TEXT);
  243|       |            /* Dangerous to set stdin/stdout to raw (unless redirected) */
  244|       |            else {
  245|       |                if (fd == STDIN_FILENO || fd == STDOUT_FILENO) {
  246|       |                    if (isatty(fd) <= 0)
  247|       |                        _setmode(fd, _O_BINARY);
  248|       |                } else
  249|       |                    _setmode(fd, _O_BINARY);
  250|       |            }
  251|       |# elif defined(OPENSSL_SYS_WIN32_CYGWIN)
  252|       |            int fd = fileno((FILE *)ptr);
  253|       |            if (!(num & BIO_FP_TEXT))
  254|       |                setmode(fd, O_BINARY);
  255|       |# endif
  256|  12.9k|        }
  257|  12.9k|        break;
  258|      0|    case BIO_C_SET_FILENAME:
  ------------------
  |  |  301|      0|# define BIO_C_SET_FILENAME                      108
  ------------------
  |  Branch (258:5): [True: 0, False: 12.9k]
  ------------------
  259|      0|        file_free(b);
  260|      0|        b->shutdown = (int)num & BIO_CLOSE;
  ------------------
  |  |   66|      0|# define BIO_CLOSE               0x01
  ------------------
  261|      0|        if (num & BIO_FP_APPEND) {
  ------------------
  |  |  147|      0|# define BIO_FP_APPEND           0x08
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  262|      0|            if (num & BIO_FP_READ)
  ------------------
  |  |  145|      0|# define BIO_FP_READ             0x02
  ------------------
  |  Branch (262:17): [True: 0, False: 0]
  ------------------
  263|      0|                OPENSSL_strlcpy(p, "a+", sizeof(p));
  264|      0|            else
  265|      0|                OPENSSL_strlcpy(p, "a", sizeof(p));
  266|      0|        } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
  ------------------
  |  |  145|      0|# define BIO_FP_READ             0x02
  ------------------
                      } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
  ------------------
  |  |  146|      0|# define BIO_FP_WRITE            0x04
  ------------------
  |  Branch (266:20): [True: 0, False: 0]
  |  Branch (266:43): [True: 0, False: 0]
  ------------------
  267|      0|            OPENSSL_strlcpy(p, "r+", sizeof(p));
  268|      0|        else if (num & BIO_FP_WRITE)
  ------------------
  |  |  146|      0|# define BIO_FP_WRITE            0x04
  ------------------
  |  Branch (268:18): [True: 0, False: 0]
  ------------------
  269|      0|            OPENSSL_strlcpy(p, "w", sizeof(p));
  270|      0|        else if (num & BIO_FP_READ)
  ------------------
  |  |  145|      0|# define BIO_FP_READ             0x02
  ------------------
  |  Branch (270:18): [True: 0, False: 0]
  ------------------
  271|      0|            OPENSSL_strlcpy(p, "r", sizeof(p));
  272|      0|        else {
  273|      0|            BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  274|      0|            ret = 0;
  275|      0|            break;
  276|      0|        }
  277|       |# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS)
  278|       |        if (!(num & BIO_FP_TEXT))
  279|       |            OPENSSL_strlcat(p, "b", sizeof(p));
  280|       |        else
  281|       |            OPENSSL_strlcat(p, "t", sizeof(p));
  282|       |# elif defined(OPENSSL_SYS_WIN32_CYGWIN)
  283|       |        if (!(num & BIO_FP_TEXT))
  284|       |            OPENSSL_strlcat(p, "b", sizeof(p));
  285|       |# endif
  286|      0|        fp = openssl_fopen(ptr, p);
  287|      0|        if (fp == NULL) {
  ------------------
  |  Branch (287:13): [True: 0, False: 0]
  ------------------
  288|      0|            SYSerr(SYS_F_FOPEN, get_last_sys_error());
  ------------------
  |  |  101|      0|# define SYSerr(f,r)  ERR_PUT_error(ERR_LIB_SYS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  289|      0|            ERR_add_error_data(5, "fopen('", ptr, "','", p, "')");
  290|      0|            BIOerr(BIO_F_FILE_CTRL, ERR_R_SYS_LIB);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  291|      0|            ret = 0;
  292|      0|            break;
  293|      0|        }
  294|      0|        b->ptr = fp;
  295|      0|        b->init = 1;
  296|      0|        BIO_clear_flags(b, BIO_FLAGS_UPLINK); /* we did fopen -> we disengage
  ------------------
  |  |  160|      0|#  define BIO_FLAGS_UPLINK        0
  ------------------
  297|       |                                               * UPLINK */
  298|      0|        break;
  299|      0|    case BIO_C_GET_FILE_PTR:
  ------------------
  |  |  300|      0|# define BIO_C_GET_FILE_PTR                      107
  ------------------
  |  Branch (299:5): [True: 0, False: 12.9k]
  ------------------
  300|       |        /* the ptr parameter is actually a FILE ** in this case. */
  301|      0|        if (ptr != NULL) {
  ------------------
  |  Branch (301:13): [True: 0, False: 0]
  ------------------
  302|      0|            fpp = (FILE **)ptr;
  303|      0|            *fpp = (FILE *)b->ptr;
  304|      0|        }
  305|      0|        break;
  306|      0|    case BIO_CTRL_GET_CLOSE:
  ------------------
  |  |   78|      0|# define BIO_CTRL_GET_CLOSE      8/* man - set the 'close' on free */
  ------------------
  |  Branch (306:5): [True: 0, False: 12.9k]
  ------------------
  307|      0|        ret = (long)b->shutdown;
  308|      0|        break;
  309|      0|    case BIO_CTRL_SET_CLOSE:
  ------------------
  |  |   79|      0|# define BIO_CTRL_SET_CLOSE      9/* man - set the 'close' on free */
  ------------------
  |  Branch (309:5): [True: 0, False: 12.9k]
  ------------------
  310|      0|        b->shutdown = (int)num;
  311|      0|        break;
  312|      0|    case BIO_CTRL_FLUSH:
  ------------------
  |  |   81|      0|# define BIO_CTRL_FLUSH          11/* opt - 'flush' buffered output */
  ------------------
  |  Branch (312:5): [True: 0, False: 12.9k]
  ------------------
  313|      0|        st = b->flags & BIO_FLAGS_UPLINK
  ------------------
  |  |  160|      0|#  define BIO_FLAGS_UPLINK        0
  ------------------
  |  Branch (313:14): [True: 0, False: 0]
  ------------------
  314|      0|                ? UP_fflush(b->ptr) : fflush((FILE *)b->ptr);
  ------------------
  |  |  171|      0|# define UP_fflush       fflush
  ------------------
  315|      0|        if (st == EOF) {
  ------------------
  |  Branch (315:13): [True: 0, False: 0]
  ------------------
  316|      0|            SYSerr(SYS_F_FFLUSH, get_last_sys_error());
  ------------------
  |  |  101|      0|# define SYSerr(f,r)  ERR_PUT_error(ERR_LIB_SYS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  317|      0|            ERR_add_error_data(1, "fflush()");
  318|      0|            BIOerr(BIO_F_FILE_CTRL, ERR_R_SYS_LIB);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  319|      0|            ret = 0;
  320|      0|        }
  321|      0|        break;
  322|      0|    case BIO_CTRL_DUP:
  ------------------
  |  |   82|      0|# define BIO_CTRL_DUP            12/* man - extra stuff for 'duped' BIO */
  ------------------
  |  Branch (322:5): [True: 0, False: 12.9k]
  ------------------
  323|      0|        ret = 1;
  324|      0|        break;
  325|       |
  326|      0|    case BIO_CTRL_WPENDING:
  ------------------
  |  |   83|      0|# define BIO_CTRL_WPENDING       13/* opt - number of bytes still to write */
  ------------------
  |  Branch (326:5): [True: 0, False: 12.9k]
  ------------------
  327|      0|    case BIO_CTRL_PENDING:
  ------------------
  |  |   80|      0|# define BIO_CTRL_PENDING        10/* opt - is their more data buffered */
  ------------------
  |  Branch (327:5): [True: 0, False: 12.9k]
  ------------------
  328|      0|    case BIO_CTRL_PUSH:
  ------------------
  |  |   76|      0|# define BIO_CTRL_PUSH           6/* opt - internal, used to signify change */
  ------------------
  |  Branch (328:5): [True: 0, False: 12.9k]
  ------------------
  329|      0|    case BIO_CTRL_POP:
  ------------------
  |  |   77|      0|# define BIO_CTRL_POP            7/* opt - internal, used to signify change */
  ------------------
  |  Branch (329:5): [True: 0, False: 12.9k]
  ------------------
  330|      0|    default:
  ------------------
  |  Branch (330:5): [True: 0, False: 12.9k]
  ------------------
  331|      0|        ret = 0;
  332|      0|        break;
  333|  12.9k|    }
  334|  12.9k|    return ret;
  335|  12.9k|}
bss_file.c:file_new:
  111|  12.9k|{
  112|  12.9k|    bi->init = 0;
  113|  12.9k|    bi->num = 0;
  114|  12.9k|    bi->ptr = NULL;
  115|  12.9k|    bi->flags = BIO_FLAGS_UPLINK; /* default to UPLINK */
  ------------------
  |  |  160|  12.9k|#  define BIO_FLAGS_UPLINK        0
  ------------------
  116|  12.9k|    return 1;
  117|  12.9k|}
bss_file.c:file_free:
  120|  25.8k|{
  121|  25.8k|    if (a == NULL)
  ------------------
  |  Branch (121:9): [True: 0, False: 25.8k]
  ------------------
  122|      0|        return 0;
  123|  25.8k|    if (a->shutdown) {
  ------------------
  |  Branch (123:9): [True: 25.8k, False: 0]
  ------------------
  124|  25.8k|        if ((a->init) && (a->ptr != NULL)) {
  ------------------
  |  Branch (124:13): [True: 12.9k, False: 12.9k]
  |  Branch (124:26): [True: 12.9k, False: 0]
  ------------------
  125|  12.9k|            if (a->flags & BIO_FLAGS_UPLINK)
  ------------------
  |  |  160|  12.9k|#  define BIO_FLAGS_UPLINK        0
  ------------------
  |  Branch (125:17): [True: 0, False: 12.9k]
  ------------------
  126|      0|                UP_fclose(a->ptr);
  ------------------
  |  |  166|      0|# define UP_fclose       fclose
  ------------------
  127|  12.9k|            else
  128|  12.9k|                fclose(a->ptr);
  129|  12.9k|            a->ptr = NULL;
  130|  12.9k|            a->flags = BIO_FLAGS_UPLINK;
  ------------------
  |  |  160|  12.9k|#  define BIO_FLAGS_UPLINK        0
  ------------------
  131|  12.9k|        }
  132|  25.8k|        a->init = 0;
  133|  25.8k|    }
  134|  25.8k|    return 1;
  135|  25.8k|}

BIO_s_mem:
   77|  2.49k|{
   78|  2.49k|    return &mem_method;
   79|  2.49k|}
bss_mem.c:mem_write:
  218|  2.49k|{
  219|  2.49k|    int ret = -1;
  220|  2.49k|    int blen;
  221|  2.49k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  222|       |
  223|  2.49k|    if (in == NULL) {
  ------------------
  |  Branch (223:9): [True: 0, False: 2.49k]
  ------------------
  224|      0|        BIOerr(BIO_F_MEM_WRITE, BIO_R_NULL_PARAMETER);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  225|      0|        goto end;
  226|      0|    }
  227|  2.49k|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  170|  2.49k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (227:9): [True: 0, False: 2.49k]
  ------------------
  228|      0|        BIOerr(BIO_F_MEM_WRITE, BIO_R_WRITE_TO_READ_ONLY_BIO);
  ------------------
  |  |  116|      0|# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  229|      0|        goto end;
  230|      0|    }
  231|  2.49k|    BIO_clear_retry_flags(b);
  ------------------
  |  |  192|  2.49k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  153|  2.49k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  2.49k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.49k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.49k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  154|  2.49k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  232|  2.49k|    if (inl == 0)
  ------------------
  |  Branch (232:9): [True: 0, False: 2.49k]
  ------------------
  233|      0|        return 0;
  234|  2.49k|    blen = bbm->readp->length;
  235|  2.49k|    mem_buf_sync(b);
  236|  2.49k|    if (BUF_MEM_grow_clean(bbm->buf, blen + inl) == 0)
  ------------------
  |  Branch (236:9): [True: 0, False: 2.49k]
  ------------------
  237|      0|        goto end;
  238|  2.49k|    memcpy(bbm->buf->data + blen, in, inl);
  239|  2.49k|    *bbm->readp = *bbm->buf;
  240|  2.49k|    ret = inl;
  241|  2.49k| end:
  242|  2.49k|    return ret;
  243|  2.49k|}
bss_mem.c:mem_buf_sync:
  181|  2.49k|{
  182|  2.49k|    if (b != NULL && b->init != 0 && b->ptr != NULL) {
  ------------------
  |  Branch (182:9): [True: 2.49k, False: 0]
  |  Branch (182:22): [True: 2.49k, False: 0]
  |  Branch (182:38): [True: 2.49k, False: 0]
  ------------------
  183|  2.49k|        BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  184|       |
  185|  2.49k|        if (bbm->readp->data != bbm->buf->data) {
  ------------------
  |  Branch (185:13): [True: 0, False: 2.49k]
  ------------------
  186|      0|            memmove(bbm->buf->data, bbm->readp->data, bbm->readp->length);
  187|      0|            bbm->buf->length = bbm->readp->length;
  188|      0|            bbm->readp->data = bbm->buf->data;
  189|      0|        }
  190|  2.49k|    }
  191|  2.49k|    return 0;
  192|  2.49k|}
bss_mem.c:mem_read:
  195|  7.47M|{
  196|  7.47M|    int ret = -1;
  197|  7.47M|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  198|  7.47M|    BUF_MEM *bm = bbm->readp;
  199|       |
  200|  7.47M|    if (b->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  170|  7.47M|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (200:9): [True: 0, False: 7.47M]
  ------------------
  201|      0|        bm = bbm->buf;
  202|  7.47M|    BIO_clear_retry_flags(b);
  ------------------
  |  |  192|  7.47M|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  153|  7.47M|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  7.47M|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  7.47M|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  7.47M|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  154|  7.47M|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  203|  7.47M|    ret = (outl >= 0 && (size_t)outl > bm->length) ? (int)bm->length : outl;
  ------------------
  |  Branch (203:12): [True: 7.47M, False: 0]
  |  Branch (203:25): [True: 0, False: 7.47M]
  ------------------
  204|  7.47M|    if ((out != NULL) && (ret > 0)) {
  ------------------
  |  Branch (204:9): [True: 7.47M, False: 0]
  |  Branch (204:26): [True: 7.47M, False: 0]
  ------------------
  205|  7.47M|        memcpy(out, bm->data, ret);
  206|  7.47M|        bm->length -= ret;
  207|  7.47M|        bm->max -= ret;
  208|  7.47M|        bm->data += ret;
  209|  7.47M|    } else if (bm->length == 0) {
  ------------------
  |  Branch (209:16): [True: 0, False: 0]
  ------------------
  210|      0|        ret = b->num;
  211|      0|        if (ret != 0)
  ------------------
  |  Branch (211:13): [True: 0, False: 0]
  ------------------
  212|      0|            BIO_set_retry_read(b);
  ------------------
  |  |  186|      0|                BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  150|      0|# define BIO_FLAGS_READ          0x01
  |  |  ------------------
  |  |                               BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  154|      0|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  213|      0|    }
  214|  7.47M|    return ret;
  215|  7.47M|}
bss_mem.c:mem_gets:
  327|  7.48M|{
  328|  7.48M|    int i, j;
  329|  7.48M|    int ret = -1;
  330|  7.48M|    char *p;
  331|  7.48M|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)bp->ptr;
  332|  7.48M|    BUF_MEM *bm = bbm->readp;
  333|       |
  334|  7.48M|    if (bp->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  170|  7.48M|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (334:9): [True: 0, False: 7.48M]
  ------------------
  335|      0|        bm = bbm->buf;
  336|  7.48M|    BIO_clear_retry_flags(bp);
  ------------------
  |  |  192|  7.48M|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  153|  7.48M|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  7.48M|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  7.48M|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  7.48M|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  154|  7.48M|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  337|  7.48M|    j = bm->length;
  338|  7.48M|    if ((size - 1) < j)
  ------------------
  |  Branch (338:9): [True: 7.44M, False: 35.1k]
  ------------------
  339|  7.44M|        j = size - 1;
  340|  7.48M|    if (j <= 0) {
  ------------------
  |  Branch (340:9): [True: 3.97k, False: 7.47M]
  ------------------
  341|  3.97k|        *buf = '\0';
  342|  3.97k|        return 0;
  343|  3.97k|    }
  344|  7.47M|    p = bm->data;
  345|  52.0M|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (345:17): [True: 51.9M, False: 88.7k]
  ------------------
  346|  51.9M|        if (p[i] == '\n') {
  ------------------
  |  Branch (346:13): [True: 7.38M, False: 44.5M]
  ------------------
  347|  7.38M|            i++;
  348|  7.38M|            break;
  349|  7.38M|        }
  350|  51.9M|    }
  351|       |
  352|       |    /*
  353|       |     * i is now the max num of bytes to copy, either j or up to
  354|       |     * and including the first newline
  355|       |     */
  356|       |
  357|  7.47M|    i = mem_read(bp, buf, i);
  358|  7.47M|    if (i > 0)
  ------------------
  |  Branch (358:9): [True: 7.47M, False: 0]
  ------------------
  359|  7.47M|        buf[i] = '\0';
  360|  7.47M|    ret = i;
  361|  7.47M|    return ret;
  362|  7.48M|}
bss_mem.c:mem_buf_free:
  162|  2.49k|{
  163|  2.49k|    if (a == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 2.49k]
  ------------------
  164|      0|        return 0;
  165|       |
  166|  2.49k|    if (a->shutdown && a->init && a->ptr != NULL) {
  ------------------
  |  Branch (166:9): [True: 2.49k, False: 0]
  |  Branch (166:24): [True: 2.49k, False: 0]
  |  Branch (166:35): [True: 2.49k, False: 0]
  ------------------
  167|  2.49k|        BIO_BUF_MEM *bb = (BIO_BUF_MEM *)a->ptr;
  168|  2.49k|        BUF_MEM *b = bb->buf;
  169|       |
  170|  2.49k|        if (a->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  170|  2.49k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (170:13): [True: 0, False: 2.49k]
  ------------------
  171|      0|            b->data = NULL;
  172|  2.49k|        BUF_MEM_free(b);
  173|  2.49k|    }
  174|  2.49k|    return 1;
  175|  2.49k|}
bss_mem.c:mem_new:
  137|  2.49k|{
  138|  2.49k|    return mem_init(bi, 0L);
  139|  2.49k|}
bss_mem.c:mem_init:
  114|  2.49k|{
  115|  2.49k|    BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));
  ------------------
  |  |  120|  2.49k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  2.49k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  2.49k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  116|       |
  117|  2.49k|    if (bb == NULL)
  ------------------
  |  Branch (117:9): [True: 0, False: 2.49k]
  ------------------
  118|      0|        return 0;
  119|  2.49k|    if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL) {
  ------------------
  |  Branch (119:9): [True: 0, False: 2.49k]
  ------------------
  120|      0|        OPENSSL_free(bb);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|      0|        return 0;
  122|      0|    }
  123|  2.49k|    if ((bb->readp = OPENSSL_zalloc(sizeof(*bb->readp))) == NULL) {
  ------------------
  |  |  120|  2.49k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  2.49k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  2.49k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (123:9): [True: 0, False: 2.49k]
  ------------------
  124|      0|        BUF_MEM_free(bb->buf);
  125|      0|        OPENSSL_free(bb);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  126|      0|        return 0;
  127|      0|    }
  128|  2.49k|    *bb->readp = *bb->buf;
  129|  2.49k|    bi->shutdown = 1;
  130|  2.49k|    bi->init = 1;
  131|  2.49k|    bi->num = -1;
  132|  2.49k|    bi->ptr = (char *)bb;
  133|  2.49k|    return 1;
  134|  2.49k|}
bss_mem.c:mem_free:
  147|  2.49k|{
  148|  2.49k|    BIO_BUF_MEM *bb;
  149|       |
  150|  2.49k|    if (a == NULL)
  ------------------
  |  Branch (150:9): [True: 0, False: 2.49k]
  ------------------
  151|      0|        return 0;
  152|       |
  153|  2.49k|    bb = (BIO_BUF_MEM *)a->ptr;
  154|  2.49k|    if (!mem_buf_free(a))
  ------------------
  |  Branch (154:9): [True: 0, False: 2.49k]
  ------------------
  155|      0|        return 0;
  156|  2.49k|    OPENSSL_free(bb->readp);
  ------------------
  |  |  128|  2.49k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  2.49k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  2.49k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  157|  2.49k|    OPENSSL_free(bb);
  ------------------
  |  |  128|  2.49k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  2.49k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  2.49k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  158|  2.49k|    return 1;
  159|  2.49k|}

ERR_load_BN_strings:
  110|      2|{
  111|      2|#ifndef OPENSSL_NO_ERR
  112|      2|    if (ERR_func_error_string(BN_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (112:9): [True: 2, False: 0]
  ------------------
  113|      2|        ERR_load_strings_const(BN_str_functs);
  114|      2|        ERR_load_strings_const(BN_str_reasons);
  115|      2|    }
  116|      2|#endif
  117|      2|    return 1;
  118|      2|}

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

BUF_MEM_new_ex:
   22|  2.49k|{
   23|  2.49k|    BUF_MEM *ret;
   24|       |
   25|  2.49k|    ret = BUF_MEM_new();
   26|  2.49k|    if (ret != NULL)
  ------------------
  |  Branch (26:9): [True: 2.49k, False: 0]
  ------------------
   27|  2.49k|        ret->flags = flags;
   28|  2.49k|    return ret;
   29|  2.49k|}
BUF_MEM_new:
   32|  45.0k|{
   33|  45.0k|    BUF_MEM *ret;
   34|       |
   35|  45.0k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  120|  45.0k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  45.0k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  45.0k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|  45.0k|    if (ret == NULL) {
  ------------------
  |  Branch (36:9): [True: 0, False: 45.0k]
  ------------------
   37|      0|        BUFerr(BUF_F_BUF_MEM_NEW, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  106|      0|# define BUFerr(f,r)  ERR_PUT_error(ERR_LIB_BUF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|  45.0k|    return ret;
   41|  45.0k|}
BUF_MEM_free:
   44|  5.21k|{
   45|  5.21k|    if (a == NULL)
  ------------------
  |  Branch (45:9): [True: 0, False: 5.21k]
  ------------------
   46|      0|        return;
   47|  5.21k|    if (a->data != NULL) {
  ------------------
  |  Branch (47:9): [True: 5.21k, False: 0]
  ------------------
   48|  5.21k|        if (a->flags & BUF_MEM_FLAG_SECURE)
  ------------------
  |  |   45|  5.21k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (48:13): [True: 0, False: 5.21k]
  ------------------
   49|      0|            OPENSSL_secure_clear_free(a->data, a->max);
  ------------------
  |  |  142|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   50|  5.21k|        else
   51|  5.21k|            OPENSSL_clear_free(a->data, a->max);
  ------------------
  |  |  126|  5.21k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  5.21k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  5.21k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|  5.21k|    }
   53|  5.21k|    OPENSSL_free(a);
  ------------------
  |  |  128|  5.21k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  5.21k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  5.21k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   54|  5.21k|}
BUF_MEM_grow:
   74|  8.03M|{
   75|  8.03M|    char *ret;
   76|  8.03M|    size_t n;
   77|       |
   78|  8.03M|    if (str->length >= len) {
  ------------------
  |  Branch (78:9): [True: 7.90M, False: 132k]
  ------------------
   79|  7.90M|        str->length = len;
   80|  7.90M|        return len;
   81|  7.90M|    }
   82|   132k|    if (str->max >= len) {
  ------------------
  |  Branch (82:9): [True: 87.2k, False: 45.3k]
  ------------------
   83|  87.2k|        if (str->data != NULL)
  ------------------
  |  Branch (83:13): [True: 87.2k, False: 0]
  ------------------
   84|  87.2k|            memset(&str->data[str->length], 0, len - str->length);
   85|  87.2k|        str->length = len;
   86|  87.2k|        return len;
   87|  87.2k|    }
   88|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
   89|  45.3k|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|  45.3k|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (89:9): [True: 0, False: 45.3k]
  ------------------
   90|      0|        BUFerr(BUF_F_BUF_MEM_GROW, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  106|      0|# define BUFerr(f,r)  ERR_PUT_error(ERR_LIB_BUF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
   91|      0|        return 0;
   92|      0|    }
   93|  45.3k|    n = (len + 3) / 3 * 4;
   94|  45.3k|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   45|  45.3k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (94:9): [True: 0, False: 45.3k]
  ------------------
   95|      0|        ret = sec_alloc_realloc(str, n);
   96|  45.3k|    else
   97|  45.3k|        ret = OPENSSL_realloc(str->data, n);
  ------------------
  |  |  122|  45.3k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  45.3k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  45.3k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   98|  45.3k|    if (ret == NULL) {
  ------------------
  |  Branch (98:9): [True: 0, False: 45.3k]
  ------------------
   99|      0|        BUFerr(BUF_F_BUF_MEM_GROW, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  106|      0|# define BUFerr(f,r)  ERR_PUT_error(ERR_LIB_BUF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  100|      0|        len = 0;
  101|  45.3k|    } else {
  102|  45.3k|        str->data = ret;
  103|  45.3k|        str->max = n;
  104|  45.3k|        memset(&str->data[str->length], 0, len - str->length);
  105|  45.3k|        str->length = len;
  106|  45.3k|    }
  107|  45.3k|    return len;
  108|  45.3k|}
BUF_MEM_grow_clean:
  111|  19.7k|{
  112|  19.7k|    char *ret;
  113|  19.7k|    size_t n;
  114|       |
  115|  19.7k|    if (str->length >= len) {
  ------------------
  |  Branch (115:9): [True: 4.37k, False: 15.3k]
  ------------------
  116|  4.37k|        if (str->data != NULL)
  ------------------
  |  Branch (116:13): [True: 4.37k, False: 0]
  ------------------
  117|  4.37k|            memset(&str->data[len], 0, str->length - len);
  118|  4.37k|        str->length = len;
  119|  4.37k|        return len;
  120|  4.37k|    }
  121|  15.3k|    if (str->max >= len) {
  ------------------
  |  Branch (121:9): [True: 2.31k, False: 13.0k]
  ------------------
  122|  2.31k|        memset(&str->data[str->length], 0, len - str->length);
  123|  2.31k|        str->length = len;
  124|  2.31k|        return len;
  125|  2.31k|    }
  126|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
  127|  13.0k|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|  13.0k|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (127:9): [True: 0, False: 13.0k]
  ------------------
  128|      0|        BUFerr(BUF_F_BUF_MEM_GROW_CLEAN, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  106|      0|# define BUFerr(f,r)  ERR_PUT_error(ERR_LIB_BUF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  129|      0|        return 0;
  130|      0|    }
  131|  13.0k|    n = (len + 3) / 3 * 4;
  132|  13.0k|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   45|  13.0k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (132:9): [True: 0, False: 13.0k]
  ------------------
  133|      0|        ret = sec_alloc_realloc(str, n);
  134|  13.0k|    else
  135|  13.0k|        ret = OPENSSL_clear_realloc(str->data, str->max, n);
  ------------------
  |  |  124|  13.0k|        CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  13.0k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  13.0k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|  13.0k|    if (ret == NULL) {
  ------------------
  |  Branch (136:9): [True: 0, False: 13.0k]
  ------------------
  137|      0|        BUFerr(BUF_F_BUF_MEM_GROW_CLEAN, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  106|      0|# define BUFerr(f,r)  ERR_PUT_error(ERR_LIB_BUF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  138|      0|        len = 0;
  139|  13.0k|    } else {
  140|  13.0k|        str->data = ret;
  141|  13.0k|        str->max = n;
  142|  13.0k|        memset(&str->data[str->length], 0, len - str->length);
  143|  13.0k|        str->length = len;
  144|  13.0k|    }
  145|  13.0k|    return len;
  146|  13.0k|}

ERR_load_CMS_strings:
  291|      2|{
  292|      2|#ifndef OPENSSL_NO_ERR
  293|      2|    if (ERR_func_error_string(CMS_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (293:9): [True: 2, False: 0]
  ------------------
  294|      2|        ERR_load_strings_const(CMS_str_functs);
  295|      2|        ERR_load_strings_const(CMS_str_reasons);
  296|      2|    }
  297|      2|#endif
  298|      2|    return 1;
  299|      2|}

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

_CONF_get_section:
   24|  12.6k|{
   25|  12.6k|    CONF_VALUE *v, vv;
   26|       |
   27|  12.6k|    if ((conf == NULL) || (section == NULL))
  ------------------
  |  Branch (27:9): [True: 0, False: 12.6k]
  |  Branch (27:27): [True: 0, False: 12.6k]
  ------------------
   28|      0|        return NULL;
   29|  12.6k|    vv.name = NULL;
   30|  12.6k|    vv.section = (char *)section;
   31|  12.6k|    v = lh_CONF_VALUE_retrieve(conf->data, &vv);
   32|  12.6k|    return v;
   33|  12.6k|}
_CONF_add_string:
   49|  28.4k|{
   50|  28.4k|    CONF_VALUE *v = NULL;
   51|  28.4k|    STACK_OF(CONF_VALUE) *ts;
  ------------------
  |  |   20|  28.4k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   52|       |
   53|  28.4k|    ts = (STACK_OF(CONF_VALUE) *)section->value;
   54|       |
   55|  28.4k|    value->section = section->section;
   56|  28.4k|    if (!sk_CONF_VALUE_push(ts, value)) {
  ------------------
  |  Branch (56:9): [True: 0, False: 28.4k]
  ------------------
   57|      0|        return 0;
   58|      0|    }
   59|       |
   60|  28.4k|    v = lh_CONF_VALUE_insert(conf->data, value);
   61|  28.4k|    if (v != NULL) {
  ------------------
  |  Branch (61:9): [True: 6.00k, False: 22.4k]
  ------------------
   62|  6.00k|        (void)sk_CONF_VALUE_delete_ptr(ts, v);
   63|  6.00k|        OPENSSL_free(v->name);
  ------------------
  |  |  128|  6.00k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  6.00k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  6.00k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|  6.00k|        OPENSSL_free(v->value);
  ------------------
  |  |  128|  6.00k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  6.00k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  6.00k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   65|  6.00k|        OPENSSL_free(v);
  ------------------
  |  |  128|  6.00k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  6.00k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  6.00k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   66|  6.00k|    }
   67|  28.4k|    return 1;
   68|  28.4k|}
_CONF_get_string:
   72|  17.4k|{
   73|  17.4k|    CONF_VALUE *v, vv;
   74|  17.4k|    char *p;
   75|       |
   76|  17.4k|    if (name == NULL)
  ------------------
  |  Branch (76:9): [True: 0, False: 17.4k]
  ------------------
   77|      0|        return NULL;
   78|  17.4k|    if (conf != NULL) {
  ------------------
  |  Branch (78:9): [True: 17.4k, False: 0]
  ------------------
   79|  17.4k|        if (section != NULL) {
  ------------------
  |  Branch (79:13): [True: 17.4k, False: 0]
  ------------------
   80|  17.4k|            vv.name = (char *)name;
   81|  17.4k|            vv.section = (char *)section;
   82|  17.4k|            v = lh_CONF_VALUE_retrieve(conf->data, &vv);
   83|  17.4k|            if (v != NULL)
  ------------------
  |  Branch (83:17): [True: 14.4k, False: 2.99k]
  ------------------
   84|  14.4k|                return v->value;
   85|  2.99k|            if (strcmp(section, "ENV") == 0) {
  ------------------
  |  Branch (85:17): [True: 504, False: 2.48k]
  ------------------
   86|    504|                p = ossl_safe_getenv(name);
   87|    504|                if (p != NULL)
  ------------------
  |  Branch (87:21): [True: 278, False: 226]
  ------------------
   88|    278|                    return p;
   89|    504|            }
   90|  2.99k|        }
   91|  2.71k|        vv.section = "default";
   92|  2.71k|        vv.name = (char *)name;
   93|  2.71k|        v = lh_CONF_VALUE_retrieve(conf->data, &vv);
   94|  2.71k|        if (v != NULL)
  ------------------
  |  Branch (94:13): [True: 2.53k, False: 180]
  ------------------
   95|  2.53k|            return v->value;
   96|    180|        else
   97|    180|            return NULL;
   98|  2.71k|    } else
   99|      0|        return ossl_safe_getenv(name);
  100|  17.4k|}
_CONF_new_data:
  127|  2.49k|{
  128|  2.49k|    if (conf == NULL) {
  ------------------
  |  Branch (128:9): [True: 0, False: 2.49k]
  ------------------
  129|      0|        return 0;
  130|      0|    }
  131|  2.49k|    if (conf->data == NULL) {
  ------------------
  |  Branch (131:9): [True: 2.49k, False: 0]
  ------------------
  132|  2.49k|        conf->data = lh_CONF_VALUE_new(conf_value_hash, conf_value_cmp);
  133|  2.49k|        if (conf->data == NULL)
  ------------------
  |  Branch (133:13): [True: 0, False: 2.49k]
  ------------------
  134|      0|            return 0;
  135|  2.49k|    }
  136|  2.49k|    return 1;
  137|  2.49k|}
_CONF_free_data:
  144|  3.35k|{
  145|  3.35k|    if (conf == NULL || conf->data == NULL)
  ------------------
  |  Branch (145:9): [True: 0, False: 3.35k]
  |  Branch (145:25): [True: 865, False: 2.49k]
  ------------------
  146|    865|        return;
  147|       |
  148|       |    /* evil thing to make sure the 'OPENSSL_free()' works as expected */
  149|  2.49k|    lh_CONF_VALUE_set_down_load(conf->data, 0);
  150|  2.49k|    lh_CONF_VALUE_doall_LH_CONF_VALUE(conf->data, value_free_hash, conf->data);
  151|       |
  152|       |    /*
  153|       |     * We now have only 'section' entries in the hash table. Due to problems
  154|       |     * with
  155|       |     */
  156|       |
  157|  2.49k|    lh_CONF_VALUE_doall(conf->data, value_free_stack_doall);
  158|  2.49k|    lh_CONF_VALUE_free(conf->data);
  159|  2.49k|}
_CONF_new_section:
  190|  13.9k|{
  191|  13.9k|    STACK_OF(CONF_VALUE) *sk = NULL;
  ------------------
  |  |   20|  13.9k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  192|  13.9k|    int i;
  193|  13.9k|    CONF_VALUE *v = NULL, *vv;
  194|       |
  195|  13.9k|    if ((sk = sk_CONF_VALUE_new_null()) == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 13.9k]
  ------------------
  196|      0|        goto err;
  197|  13.9k|    if ((v = OPENSSL_malloc(sizeof(*v))) == NULL)
  ------------------
  |  |  118|  13.9k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  13.9k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  13.9k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (197:9): [True: 0, False: 13.9k]
  ------------------
  198|      0|        goto err;
  199|  13.9k|    i = strlen(section) + 1;
  200|  13.9k|    if ((v->section = OPENSSL_malloc(i)) == NULL)
  ------------------
  |  |  118|  13.9k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  13.9k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  13.9k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (200:9): [True: 0, False: 13.9k]
  ------------------
  201|      0|        goto err;
  202|       |
  203|  13.9k|    memcpy(v->section, section, i);
  204|  13.9k|    v->name = NULL;
  205|  13.9k|    v->value = (char *)sk;
  206|       |
  207|  13.9k|    vv = lh_CONF_VALUE_insert(conf->data, v);
  208|  13.9k|    if (vv != NULL || lh_CONF_VALUE_error(conf->data) > 0)
  ------------------
  |  Branch (208:9): [True: 0, False: 13.9k]
  |  Branch (208:23): [True: 0, False: 13.9k]
  ------------------
  209|      0|        goto err;
  210|  13.9k|    return v;
  211|       |
  212|      0| err:
  213|      0|    sk_CONF_VALUE_free(sk);
  214|      0|    if (v != NULL)
  ------------------
  |  Branch (214:9): [True: 0, False: 0]
  ------------------
  215|      0|        OPENSSL_free(v->section);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  216|      0|    OPENSSL_free(v);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  217|      0|    return NULL;
  218|  13.9k|}
conf_api.c:conf_value_hash:
  103|  97.6k|{
  104|  97.6k|    return (OPENSSL_LH_strhash(v->section) << 2) ^ OPENSSL_LH_strhash(v->name);
  105|  97.6k|}
conf_api.c:conf_value_cmp:
  108|  89.6k|{
  109|  89.6k|    int i;
  110|       |
  111|  89.6k|    if (a->section != b->section) {
  ------------------
  |  Branch (111:9): [True: 37.1k, False: 52.4k]
  ------------------
  112|  37.1k|        i = strcmp(a->section, b->section);
  113|  37.1k|        if (i)
  ------------------
  |  Branch (113:13): [True: 1.33k, False: 35.8k]
  ------------------
  114|  1.33k|            return i;
  115|  37.1k|    }
  116|       |
  117|  88.2k|    if ((a->name != NULL) && (b->name != NULL)) {
  ------------------
  |  Branch (117:9): [True: 46.3k, False: 41.8k]
  |  Branch (117:30): [True: 46.1k, False: 272]
  ------------------
  118|  46.1k|        i = strcmp(a->name, b->name);
  119|  46.1k|        return i;
  120|  46.1k|    } else if (a->name == b->name)
  ------------------
  |  Branch (120:16): [True: 1.19k, False: 40.9k]
  ------------------
  121|  1.19k|        return 0;
  122|  40.9k|    else
  123|  40.9k|        return ((a->name == NULL) ? -1 : 1);
  ------------------
  |  Branch (123:17): [True: 40.6k, False: 272]
  ------------------
  124|  88.2k|}
conf_api.c:value_free_hash:
  162|  36.4k|{
  163|  36.4k|    if (a->name != NULL)
  ------------------
  |  Branch (163:9): [True: 22.4k, False: 13.9k]
  ------------------
  164|  22.4k|        (void)lh_CONF_VALUE_delete(conf, a);
  165|  36.4k|}
conf_api.c:value_free_stack_doall:
  168|  13.9k|{
  169|  13.9k|    CONF_VALUE *vv;
  170|  13.9k|    STACK_OF(CONF_VALUE) *sk;
  ------------------
  |  |   20|  13.9k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  171|  13.9k|    int i;
  172|       |
  173|  13.9k|    if (a->name != NULL)
  ------------------
  |  Branch (173:9): [True: 0, False: 13.9k]
  ------------------
  174|      0|        return;
  175|       |
  176|  13.9k|    sk = (STACK_OF(CONF_VALUE) *)a->value;
  177|  36.4k|    for (i = sk_CONF_VALUE_num(sk) - 1; i >= 0; i--) {
  ------------------
  |  Branch (177:41): [True: 22.4k, False: 13.9k]
  ------------------
  178|  22.4k|        vv = sk_CONF_VALUE_value(sk, i);
  179|  22.4k|        OPENSSL_free(vv->value);
  ------------------
  |  |  128|  22.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  22.4k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  22.4k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  180|  22.4k|        OPENSSL_free(vv->name);
  ------------------
  |  |  128|  22.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  22.4k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  22.4k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  181|  22.4k|        OPENSSL_free(vv);
  ------------------
  |  |  128|  22.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  22.4k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  22.4k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  182|  22.4k|    }
  183|  13.9k|    sk_CONF_VALUE_free(sk);
  184|  13.9k|    OPENSSL_free(a->section);
  ------------------
  |  |  128|  13.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  13.9k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  13.9k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  185|  13.9k|    OPENSSL_free(a);
  ------------------
  |  |  128|  13.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  13.9k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  13.9k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  186|  13.9k|}

NCONF_default:
   93|  2.49k|{
   94|  2.49k|    return &default_method;
   95|  2.49k|}
conf_def.c:def_create:
  103|  2.49k|{
  104|  2.49k|    CONF *ret;
  105|       |
  106|  2.49k|    ret = OPENSSL_malloc(sizeof(*ret));
  ------------------
  |  |  118|  2.49k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  2.49k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  2.49k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  107|  2.49k|    if (ret != NULL)
  ------------------
  |  Branch (107:9): [True: 2.49k, False: 0]
  ------------------
  108|  2.49k|        if (meth->init(ret) == 0) {
  ------------------
  |  Branch (108:13): [True: 0, False: 2.49k]
  ------------------
  109|      0|            OPENSSL_free(ret);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  110|      0|            ret = NULL;
  111|      0|        }
  112|  2.49k|    return ret;
  113|  2.49k|}
conf_def.c:def_init_default:
  116|  3.35k|{
  117|  3.35k|    if (conf == NULL)
  ------------------
  |  Branch (117:9): [True: 0, False: 3.35k]
  ------------------
  118|      0|        return 0;
  119|       |
  120|  3.35k|    conf->meth = &default_method;
  121|  3.35k|    conf->meth_data = (void *)CONF_type_default;
  122|  3.35k|    conf->data = NULL;
  123|       |
  124|  3.35k|    return 1;
  125|  3.35k|}
conf_def.c:def_destroy:
  140|  2.49k|{
  141|  2.49k|    if (def_destroy_data(conf)) {
  ------------------
  |  Branch (141:9): [True: 2.49k, False: 0]
  ------------------
  142|  2.49k|        OPENSSL_free(conf);
  ------------------
  |  |  128|  2.49k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  2.49k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  2.49k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  143|  2.49k|        return 1;
  144|  2.49k|    }
  145|      0|    return 0;
  146|  2.49k|}
conf_def.c:def_destroy_data:
  149|  3.35k|{
  150|  3.35k|    if (conf == NULL)
  ------------------
  |  Branch (150:9): [True: 0, False: 3.35k]
  ------------------
  151|      0|        return 0;
  152|  3.35k|    _CONF_free_data(conf);
  153|  3.35k|    return 1;
  154|  3.35k|}
conf_def.c:def_load_bio:
  181|  2.49k|{
  182|       |/* The macro BUFSIZE conflicts with a system macro in VxWorks */
  183|  2.49k|#define CONFBUFSIZE     512
  184|  2.49k|    int bufnum = 0, i, ii;
  185|  2.49k|    BUF_MEM *buff = NULL;
  186|  2.49k|    char *s, *p, *end;
  187|  2.49k|    int again;
  188|  2.49k|    int first_call = 1;
  189|  2.49k|    long eline = 0;
  190|  2.49k|    char btmp[DECIMAL_SIZE(eline) + 1];
  191|  2.49k|    CONF_VALUE *v = NULL, *tv;
  192|  2.49k|    CONF_VALUE *sv = NULL;
  193|  2.49k|    char *section = NULL, *buf;
  194|  2.49k|    char *start, *psection, *pname;
  195|  2.49k|    void *h = (void *)(conf->data);
  196|  2.49k|    STACK_OF(BIO) *biosk = NULL;
  ------------------
  |  |   20|  2.49k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  197|  2.49k|#ifndef OPENSSL_NO_POSIX_IO
  198|  2.49k|    char *dirpath = NULL;
  199|  2.49k|    OPENSSL_DIR_CTX *dirctx = NULL;
  200|  2.49k|#endif
  201|       |
  202|  2.49k|    if ((buff = BUF_MEM_new()) == NULL) {
  ------------------
  |  Branch (202:9): [True: 0, False: 2.49k]
  ------------------
  203|      0|        CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_BUF_LIB);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  204|      0|        goto err;
  205|      0|    }
  206|       |
  207|  2.49k|    section = OPENSSL_strdup("default");
  ------------------
  |  |  132|  2.49k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  2.49k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  2.49k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|  2.49k|    if (section == NULL) {
  ------------------
  |  Branch (208:9): [True: 0, False: 2.49k]
  ------------------
  209|      0|        CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  210|      0|        goto err;
  211|      0|    }
  212|       |
  213|  2.49k|    if (_CONF_new_data(conf) == 0) {
  ------------------
  |  Branch (213:9): [True: 0, False: 2.49k]
  ------------------
  214|      0|        CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  215|      0|        goto err;
  216|      0|    }
  217|       |
  218|  2.49k|    sv = _CONF_new_section(conf, section);
  219|  2.49k|    if (sv == NULL) {
  ------------------
  |  Branch (219:9): [True: 0, False: 2.49k]
  ------------------
  220|      0|        CONFerr(CONF_F_DEF_LOAD_BIO, CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  221|      0|        goto err;
  222|      0|    }
  223|       |
  224|  2.49k|    bufnum = 0;
  225|  2.49k|    again = 0;
  226|  7.99M|    for (;;) {
  227|  7.99M|        if (!BUF_MEM_grow(buff, bufnum + CONFBUFSIZE)) {
  ------------------
  |  |  183|  7.99M|#define CONFBUFSIZE     512
  ------------------
  |  Branch (227:13): [True: 0, False: 7.99M]
  ------------------
  228|      0|            CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_BUF_LIB);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  229|      0|            goto err;
  230|      0|        }
  231|  7.99M|        p = &(buff->data[bufnum]);
  232|  7.99M|        *p = '\0';
  233|  8.00M| read_retry:
  234|  8.00M|        BIO_gets(in, p, CONFBUFSIZE - 1);
  ------------------
  |  |  183|  8.00M|#define CONFBUFSIZE     512
  ------------------
  235|  8.00M|        p[CONFBUFSIZE - 1] = '\0';
  ------------------
  |  |  183|  8.00M|#define CONFBUFSIZE     512
  ------------------
  236|  8.00M|        ii = i = strlen(p);
  237|  8.00M|        if (first_call) {
  ------------------
  |  Branch (237:13): [True: 2.49k, False: 8.00M]
  ------------------
  238|       |            /* Other BOMs imply unsupported multibyte encoding,
  239|       |             * so don't strip them and let the error raise */
  240|  2.49k|            const unsigned char utf8_bom[3] = {0xEF, 0xBB, 0xBF};
  241|       |
  242|  2.49k|            if (i >= 3 && memcmp(p, utf8_bom, 3) == 0) {
  ------------------
  |  Branch (242:17): [True: 2.01k, False: 478]
  |  Branch (242:27): [True: 7, False: 2.00k]
  ------------------
  243|      7|                memmove(p, p + 3, i - 3);
  244|      7|                p[i - 3] = 0;
  245|      7|                i -= 3;
  246|      7|                ii -= 3;
  247|      7|            }
  248|  2.49k|            first_call = 0;
  249|  2.49k|        }
  250|  8.00M|        if (i == 0 && !again) {
  ------------------
  |  Branch (250:13): [True: 17.1k, False: 7.99M]
  |  Branch (250:23): [True: 14.5k, False: 2.58k]
  ------------------
  251|       |            /* the currently processed BIO is at EOF */
  252|  14.5k|            BIO *parent;
  253|       |
  254|  14.5k|#ifndef OPENSSL_NO_POSIX_IO
  255|       |            /* continue processing with the next file from directory */
  256|  14.5k|            if (dirctx != NULL) {
  ------------------
  |  Branch (256:17): [True: 12.8k, False: 1.62k]
  ------------------
  257|  12.8k|                BIO *next;
  258|       |
  259|  12.8k|                if ((next = get_next_file(dirpath, &dirctx)) != NULL) {
  ------------------
  |  Branch (259:21): [True: 6.45k, False: 6.43k]
  ------------------
  260|  6.45k|                    BIO_vfree(in);
  261|  6.45k|                    in = next;
  262|  6.45k|                    goto read_retry;
  263|  6.45k|                } else {
  264|  6.43k|                    OPENSSL_free(dirpath);
  ------------------
  |  |  128|  6.43k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  6.43k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  6.43k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  265|  6.43k|                    dirpath = NULL;
  266|  6.43k|                }
  267|  12.8k|            }
  268|  8.06k|#endif
  269|       |            /* no more files in directory, continue with processing parent */
  270|  8.06k|            if ((parent = sk_BIO_pop(biosk)) == NULL) {
  ------------------
  |  Branch (270:17): [True: 1.62k, False: 6.43k]
  ------------------
  271|       |                /* everything processed get out of the loop */
  272|  1.62k|                break;
  273|  6.43k|            } else {
  274|  6.43k|                BIO_vfree(in);
  275|  6.43k|                in = parent;
  276|  6.43k|                goto read_retry;
  277|  6.43k|            }
  278|  8.06k|        }
  279|  7.99M|        again = 0;
  280|  15.8M|        while (i > 0) {
  ------------------
  |  Branch (280:16): [True: 8.52M, False: 7.36M]
  ------------------
  281|  8.52M|            if ((p[i - 1] != '\r') && (p[i - 1] != '\n'))
  ------------------
  |  Branch (281:17): [True: 8.52M, False: 63]
  |  Branch (281:39): [True: 626k, False: 7.90M]
  ------------------
  282|   626k|                break;
  283|  7.90M|            else
  284|  7.90M|                i--;
  285|  8.52M|        }
  286|       |        /*
  287|       |         * we removed some trailing stuff so there is a new line on the end.
  288|       |         */
  289|  7.99M|        if (ii && i == ii)
  ------------------
  |  Branch (289:13): [True: 7.99M, False: 2.58k]
  |  Branch (289:19): [True: 89.9k, False: 7.90M]
  ------------------
  290|  89.9k|            again = 1;          /* long line */
  291|  7.90M|        else {
  292|  7.90M|            p[i] = '\0';
  293|  7.90M|            eline++;            /* another input line */
  294|  7.90M|        }
  295|       |
  296|       |        /* we now have a line with trailing \r\n removed */
  297|       |
  298|       |        /* i is the number of bytes */
  299|  7.99M|        bufnum += i;
  300|       |
  301|  7.99M|        v = NULL;
  302|       |        /* check for line continuation */
  303|  7.99M|        if (bufnum >= 1) {
  ------------------
  |  Branch (303:13): [True: 628k, False: 7.36M]
  ------------------
  304|       |            /*
  305|       |             * If we have bytes and the last char '\\' and second last char
  306|       |             * is not '\\'
  307|       |             */
  308|   628k|            p = &(buff->data[bufnum - 1]);
  309|   628k|            if (IS_ESC(conf, p[0]) && ((bufnum <= 1) || !IS_ESC(conf, p[-1]))) {
  ------------------
  |  |   32|  1.25M|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|   628k|#define CONF_ESC          32
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 3.04k, False: 625k]
  |  |  ------------------
  ------------------
                          if (IS_ESC(conf, p[0]) && ((bufnum <= 1) || !IS_ESC(conf, p[-1]))) {
  ------------------
  |  |   32|  2.60k|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|  2.60k|#define CONF_ESC          32
  |  |  ------------------
  ------------------
  |  Branch (309:40): [True: 440, False: 2.60k]
  |  Branch (309:57): [True: 1.52k, False: 1.07k]
  ------------------
  310|  1.96k|                bufnum--;
  311|  1.96k|                again = 1;
  312|  1.96k|            }
  313|   628k|        }
  314|  7.99M|        if (again)
  ------------------
  |  Branch (314:13): [True: 91.1k, False: 7.90M]
  ------------------
  315|  91.1k|            continue;
  316|  7.90M|        bufnum = 0;
  317|  7.90M|        buf = buff->data;
  318|       |
  319|  7.90M|        clear_comments(conf, buf);
  320|  7.90M|        s = eat_ws(conf, buf);
  321|  7.90M|        if (IS_EOF(conf, *s))
  ------------------
  |  |   31|  7.90M|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   23|  7.90M|#define CONF_EOF          8
  |  |  ------------------
  |  |  |  Branch (31:32): [True: 7.86M, False: 40.6k]
  |  |  ------------------
  ------------------
  322|  7.86M|            continue;           /* blank line */
  323|  40.6k|        if (*s == '[') {
  ------------------
  |  Branch (323:13): [True: 3.16k, False: 37.5k]
  ------------------
  324|  3.16k|            char *ss;
  325|       |
  326|  3.16k|            s++;
  327|  3.16k|            start = eat_ws(conf, s);
  328|  3.16k|            ss = start;
  329|  3.72k| again:
  330|  3.72k|            end = eat_alpha_numeric(conf, ss);
  331|  3.72k|            p = eat_ws(conf, end);
  332|  3.72k|            if (*p != ']') {
  ------------------
  |  Branch (332:17): [True: 653, False: 3.06k]
  ------------------
  333|    653|                if (*p != '\0' && ss != p) {
  ------------------
  |  Branch (333:21): [True: 596, False: 57]
  |  Branch (333:35): [True: 554, False: 42]
  ------------------
  334|    554|                    ss = p;
  335|    554|                    goto again;
  336|    554|                }
  337|     99|                CONFerr(CONF_F_DEF_LOAD_BIO,
  ------------------
  |  |  112|     99|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|     99|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  338|     99|                        CONF_R_MISSING_CLOSE_SQUARE_BRACKET);
  339|     99|                goto err;
  340|    653|            }
  341|  3.06k|            *end = '\0';
  342|  3.06k|            if (!str_copy(conf, NULL, &section, start))
  ------------------
  |  Branch (342:17): [True: 0, False: 3.06k]
  ------------------
  343|      0|                goto err;
  344|  3.06k|            if ((sv = _CONF_get_section(conf, section)) == NULL)
  ------------------
  |  Branch (344:17): [True: 2.56k, False: 501]
  ------------------
  345|  2.56k|                sv = _CONF_new_section(conf, section);
  346|  3.06k|            if (sv == NULL) {
  ------------------
  |  Branch (346:17): [True: 0, False: 3.06k]
  ------------------
  347|      0|                CONFerr(CONF_F_DEF_LOAD_BIO,
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  348|      0|                        CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
  349|      0|                goto err;
  350|      0|            }
  351|  3.06k|            continue;
  352|  37.5k|        } else {
  353|  37.5k|            pname = s;
  354|  37.5k|            end = eat_alpha_numeric(conf, s);
  355|  37.5k|            if ((end[0] == ':') && (end[1] == ':')) {
  ------------------
  |  Branch (355:17): [True: 9.87k, False: 27.6k]
  |  Branch (355:36): [True: 9.63k, False: 243]
  ------------------
  356|  9.63k|                *end = '\0';
  357|  9.63k|                end += 2;
  358|  9.63k|                psection = pname;
  359|  9.63k|                pname = end;
  360|  9.63k|                end = eat_alpha_numeric(conf, end);
  361|  27.8k|            } else {
  362|  27.8k|                psection = section;
  363|  27.8k|            }
  364|  37.5k|            p = eat_ws(conf, end);
  365|  37.5k|            if (strncmp(pname, ".include", 8) == 0
  ------------------
  |  Branch (365:17): [True: 8.31k, False: 29.2k]
  ------------------
  366|  37.5k|                && (p != pname + 8 || *p == '=')) {
  ------------------
  |  Branch (366:21): [True: 7.93k, False: 372]
  |  Branch (366:39): [True: 361, False: 11]
  ------------------
  367|  8.30k|                char *include = NULL;
  368|  8.30k|                BIO *next;
  369|       |
  370|  8.30k|                if (*p == '=') {
  ------------------
  |  Branch (370:21): [True: 375, False: 7.92k]
  ------------------
  371|    375|                    p++;
  372|    375|                    p = eat_ws(conf, p);
  373|    375|                }
  374|  8.30k|                trim_ws(conf, p);
  375|  8.30k|                if (!str_copy(conf, psection, &include, p))
  ------------------
  |  Branch (375:21): [True: 3, False: 8.29k]
  ------------------
  376|      3|                    goto err;
  377|       |                /* get the BIO of the included file */
  378|  8.29k|#ifndef OPENSSL_NO_POSIX_IO
  379|  8.29k|                next = process_include(include, &dirctx, &dirpath);
  380|  8.29k|                if (include != dirpath) {
  ------------------
  |  Branch (380:21): [True: 1.84k, False: 6.45k]
  ------------------
  381|       |                    /* dirpath will contain include in case of a directory */
  382|  1.84k|                    OPENSSL_free(include);
  ------------------
  |  |  128|  1.84k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  1.84k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  1.84k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  383|  1.84k|                }
  384|       |#else
  385|       |                next = BIO_new_file(include, "r");
  386|       |                OPENSSL_free(include);
  387|       |#endif
  388|  8.29k|                if (next != NULL) {
  ------------------
  |  Branch (388:21): [True: 6.47k, False: 1.82k]
  ------------------
  389|       |                    /* push the currently processing BIO onto stack */
  390|  6.47k|                    if (biosk == NULL) {
  ------------------
  |  Branch (390:25): [True: 118, False: 6.35k]
  ------------------
  391|    118|                        if ((biosk = sk_BIO_new_null()) == NULL) {
  ------------------
  |  Branch (391:29): [True: 0, False: 118]
  ------------------
  392|      0|                            CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  393|      0|                            BIO_free(next);
  394|      0|                            goto err;
  395|      0|                        }
  396|    118|                    }
  397|  6.47k|                    if (!sk_BIO_push(biosk, in)) {
  ------------------
  |  Branch (397:25): [True: 0, False: 6.47k]
  ------------------
  398|      0|                        CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  399|      0|                        BIO_free(next);
  400|      0|                        goto err;
  401|      0|                    }
  402|       |                    /* continue with reading from the included BIO */
  403|  6.47k|                    in = next;
  404|  6.47k|                }
  405|  8.29k|                continue;
  406|  29.2k|            } else if (*p != '=') {
  ------------------
  |  Branch (406:24): [True: 542, False: 28.6k]
  ------------------
  407|    542|                CONFerr(CONF_F_DEF_LOAD_BIO, CONF_R_MISSING_EQUAL_SIGN);
  ------------------
  |  |  112|    542|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|    542|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  408|    542|                goto err;
  409|    542|            }
  410|  28.6k|            *end = '\0';
  411|  28.6k|            p++;
  412|  28.6k|            start = eat_ws(conf, p);
  413|  28.6k|            trim_ws(conf, start);
  414|       |
  415|  28.6k|            if ((v = OPENSSL_malloc(sizeof(*v))) == NULL) {
  ------------------
  |  |  118|  28.6k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  28.6k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  28.6k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (415:17): [True: 0, False: 28.6k]
  ------------------
  416|      0|                CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  417|      0|                goto err;
  418|      0|            }
  419|  28.6k|            v->name = OPENSSL_strdup(pname);
  ------------------
  |  |  132|  28.6k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  28.6k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  28.6k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  420|  28.6k|            v->value = NULL;
  421|  28.6k|            if (v->name == NULL) {
  ------------------
  |  Branch (421:17): [True: 0, False: 28.6k]
  ------------------
  422|      0|                CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  423|      0|                goto err;
  424|      0|            }
  425|  28.6k|            if (!str_copy(conf, psection, &(v->value), start))
  ------------------
  |  Branch (425:17): [True: 221, False: 28.4k]
  ------------------
  426|    221|                goto err;
  427|       |
  428|  28.4k|            if (strcmp(psection, section) != 0) {
  ------------------
  |  Branch (428:17): [True: 9.57k, False: 18.8k]
  ------------------
  429|  9.57k|                if ((tv = _CONF_get_section(conf, psection))
  ------------------
  |  Branch (429:21): [True: 8.88k, False: 691]
  ------------------
  430|  9.57k|                    == NULL)
  431|  8.88k|                    tv = _CONF_new_section(conf, psection);
  432|  9.57k|                if (tv == NULL) {
  ------------------
  |  Branch (432:21): [True: 0, False: 9.57k]
  ------------------
  433|      0|                    CONFerr(CONF_F_DEF_LOAD_BIO,
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  434|      0|                            CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
  435|      0|                    goto err;
  436|      0|                }
  437|  9.57k|            } else
  438|  18.8k|                tv = sv;
  439|  28.4k|            if (_CONF_add_string(conf, tv, v) == 0) {
  ------------------
  |  Branch (439:17): [True: 0, False: 28.4k]
  ------------------
  440|      0|                CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  441|      0|                goto err;
  442|      0|            }
  443|  28.4k|            v = NULL;
  444|  28.4k|        }
  445|  40.6k|    }
  446|  1.62k|    BUF_MEM_free(buff);
  447|  1.62k|    OPENSSL_free(section);
  ------------------
  |  |  128|  1.62k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  1.62k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  1.62k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  448|       |    /*
  449|       |     * No need to pop, since we only get here if the stack is empty.
  450|       |     * If this causes a BIO leak, THE ISSUE IS SOMEWHERE ELSE!
  451|       |     */
  452|  1.62k|    sk_BIO_free(biosk);
  453|  1.62k|    return 1;
  454|    865| err:
  455|    865|    BUF_MEM_free(buff);
  456|    865|    OPENSSL_free(section);
  ------------------
  |  |  128|    865|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|    865|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|    865|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  457|       |    /*
  458|       |     * Since |in| is the first element of the stack and should NOT be freed
  459|       |     * here, we cannot use sk_BIO_pop_free().  Instead, we pop and free one
  460|       |     * BIO at a time, making sure that the last one popped isn't.
  461|       |     */
  462|    906|    while (sk_BIO_num(biosk) > 0) {
  ------------------
  |  Branch (462:12): [True: 41, False: 865]
  ------------------
  463|     41|        BIO *popped = sk_BIO_pop(biosk);
  464|     41|        BIO_vfree(in);
  465|     41|        in = popped;
  466|     41|    }
  467|    865|    sk_BIO_free(biosk);
  468|    865|#ifndef OPENSSL_NO_POSIX_IO
  469|    865|    OPENSSL_free(dirpath);
  ------------------
  |  |  128|    865|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|    865|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|    865|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  470|    865|    if (dirctx != NULL)
  ------------------
  |  Branch (470:9): [True: 22, False: 843]
  ------------------
  471|     22|        OPENSSL_DIR_end(&dirctx);
  472|    865|#endif
  473|    865|    if (line != NULL)
  ------------------
  |  Branch (473:9): [True: 865, False: 0]
  ------------------
  474|    865|        *line = eline;
  475|    865|    BIO_snprintf(btmp, sizeof(btmp), "%ld", eline);
  476|    865|    ERR_add_error_data(2, "line ", btmp);
  477|    865|    if (h != conf->data) {
  ------------------
  |  Branch (477:9): [True: 865, False: 0]
  ------------------
  478|    865|        CONF_free(conf->data);
  479|    865|        conf->data = NULL;
  480|    865|    }
  481|    865|    if (v != NULL) {
  ------------------
  |  Branch (481:9): [True: 221, False: 644]
  ------------------
  482|    221|        OPENSSL_free(v->name);
  ------------------
  |  |  128|    221|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|    221|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|    221|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  483|    221|        OPENSSL_free(v->value);
  ------------------
  |  |  128|    221|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|    221|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|    221|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  484|    221|        OPENSSL_free(v);
  ------------------
  |  |  128|    221|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|    221|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|    221|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  485|    221|    }
  486|    865|    return 0;
  487|  2.49k|}
conf_def.c:get_next_file:
  720|  19.8k|{
  721|  19.8k|    const char *filename;
  722|  19.8k|    size_t pathlen;
  723|       |
  724|  19.8k|    pathlen = strlen(path);
  725|   634k|    while ((filename = OPENSSL_DIR_read(dirctx, path)) != NULL) {
  ------------------
  |  Branch (725:12): [True: 627k, False: 6.93k]
  ------------------
  726|   627k|        size_t namelen;
  727|       |
  728|   627k|        namelen = strlen(filename);
  729|       |
  730|       |
  731|   627k|        if ((namelen > 5 && strcasecmp(filename + namelen - 5, ".conf") == 0)
  ------------------
  |  Branch (731:14): [True: 426k, False: 201k]
  |  Branch (731:29): [True: 97.2k, False: 328k]
  ------------------
  732|   627k|            || (namelen > 4 && strcasecmp(filename + namelen - 4, ".cnf") == 0)) {
  ------------------
  |  Branch (732:17): [True: 440k, False: 89.8k]
  |  Branch (732:32): [True: 0, False: 440k]
  ------------------
  733|  97.2k|            size_t newlen;
  734|  97.2k|            char *newpath;
  735|  97.2k|            BIO *bio;
  736|       |
  737|  97.2k|            newlen = pathlen + namelen + 2;
  738|  97.2k|            newpath = OPENSSL_zalloc(newlen);
  ------------------
  |  |  120|  97.2k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  97.2k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  97.2k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  739|  97.2k|            if (newpath == NULL) {
  ------------------
  |  Branch (739:17): [True: 0, False: 97.2k]
  ------------------
  740|      0|                CONFerr(CONF_F_GET_NEXT_FILE, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  741|      0|                break;
  742|      0|            }
  743|       |#ifdef OPENSSL_SYS_VMS
  744|       |            /*
  745|       |             * If the given path isn't clear VMS syntax,
  746|       |             * we treat it as on Unix.
  747|       |             */
  748|       |            if (path[pathlen - 1] == ']'
  749|       |                || path[pathlen - 1] == '>'
  750|       |                || path[pathlen - 1] == ':') {
  751|       |                /* Clear VMS directory syntax, just copy as is */
  752|       |                OPENSSL_strlcpy(newpath, path, newlen);
  753|       |            }
  754|       |#endif
  755|  97.2k|            if (newpath[0] == '\0') {
  ------------------
  |  Branch (755:17): [True: 97.2k, False: 0]
  ------------------
  756|  97.2k|                OPENSSL_strlcpy(newpath, path, newlen);
  757|  97.2k|                OPENSSL_strlcat(newpath, "/", newlen);
  758|  97.2k|            }
  759|  97.2k|            OPENSSL_strlcat(newpath, filename, newlen);
  760|       |
  761|  97.2k|            bio = BIO_new_file(newpath, "r");
  762|  97.2k|            OPENSSL_free(newpath);
  ------------------
  |  |  128|  97.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  97.2k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  97.2k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  763|       |            /* Errors when opening files are non-fatal. */
  764|  97.2k|            if (bio != NULL)
  ------------------
  |  Branch (764:17): [True: 12.9k, False: 84.3k]
  ------------------
  765|  12.9k|                return bio;
  766|  97.2k|        }
  767|   627k|    }
  768|  6.93k|    OPENSSL_DIR_end(dirctx);
  769|  6.93k|    *dirctx = NULL;
  770|  6.93k|    return NULL;
  771|  19.8k|}
conf_def.c:is_keytype:
  775|   376M|{
  776|   376M|    const unsigned short * keytypes = (const unsigned short *) conf->meth_data;
  777|   376M|    unsigned char key = (unsigned char)c;
  778|       |
  779|       |#ifdef CHARSET_EBCDIC
  780|       |# if CHAR_BIT > 8
  781|       |    if (key > 255) {
  782|       |        /* key is out of range for os_toascii table */
  783|       |        return 0;
  784|       |    }
  785|       |# endif
  786|       |    /* convert key from ebcdic to ascii */
  787|       |    key = os_toascii[key];
  788|       |#endif
  789|       |
  790|   376M|    if (key > 127) {
  ------------------
  |  Branch (790:9): [True: 28.2M, False: 348M]
  ------------------
  791|       |        /* key is not a seven bit ascii character */
  792|  28.2M|        return 0;
  793|  28.2M|    }
  794|       |
  795|   348M|    return (keytypes[key] & type) ? 1 : 0;
  ------------------
  |  Branch (795:12): [True: 29.4M, False: 318M]
  ------------------
  796|   376M|}
conf_def.c:clear_comments:
  490|  7.90M|{
  491|  7.90M|    for (;;) {
  492|  7.90M|        if (IS_FCOMMENT(conf, *p)) {
  ------------------
  |  |   30|  7.90M|#define IS_FCOMMENT(conf,c)    is_keytype(conf, c, CONF_FCOMMENT)
  |  |  ------------------
  |  |  |  |   22|  7.90M|#define CONF_FCOMMENT     2048
  |  |  ------------------
  |  |  |  Branch (30:32): [True: 0, False: 7.90M]
  |  |  ------------------
  ------------------
  493|      0|            *p = '\0';
  494|      0|            return;
  495|      0|        }
  496|  7.90M|        if (!IS_WS(conf, *p)) {
  ------------------
  |  |   34|  7.90M|#define IS_WS(conf,c)          is_keytype(conf, c, CONF_WS)
  |  |  ------------------
  |  |  |  |   17|  7.90M|#define CONF_WS           16
  |  |  ------------------
  ------------------
  |  Branch (496:13): [True: 7.90M, False: 629]
  ------------------
  497|  7.90M|            break;
  498|  7.90M|        }
  499|    629|        p++;
  500|    629|    }
  501|       |
  502|  34.4M|    for (;;) {
  503|  34.4M|        if (IS_COMMENT(conf, *p)) {
  ------------------
  |  |   29|  34.4M|#define IS_COMMENT(conf,c)     is_keytype(conf, c, CONF_COMMENT)
  |  |  ------------------
  |  |  |  |   21|  34.4M|#define CONF_COMMENT      128
  |  |  ------------------
  |  |  |  Branch (29:32): [True: 497k, False: 33.9M]
  |  |  ------------------
  ------------------
  504|   497k|            *p = '\0';
  505|   497k|            return;
  506|   497k|        }
  507|  33.9M|        if (IS_DQUOTE(conf, *p)) {
  ------------------
  |  |   38|  33.9M|#define IS_DQUOTE(conf,c)      is_keytype(conf, c, CONF_DQUOTE)
  |  |  ------------------
  |  |  |  |   20|  33.9M|#define CONF_DQUOTE       1024
  |  |  ------------------
  |  |  |  Branch (38:32): [True: 0, False: 33.9M]
  |  |  ------------------
  ------------------
  508|      0|            p = scan_dquote(conf, p);
  509|      0|            continue;
  510|      0|        }
  511|  33.9M|        if (IS_QUOTE(conf, *p)) {
  ------------------
  |  |   37|  33.9M|#define IS_QUOTE(conf,c)       is_keytype(conf, c, CONF_QUOTE)
  |  |  ------------------
  |  |  |  |   19|  33.9M|#define CONF_QUOTE        64
  |  |  ------------------
  |  |  |  Branch (37:32): [True: 2.55k, False: 33.9M]
  |  |  ------------------
  ------------------
  512|  2.55k|            p = scan_quote(conf, p);
  513|  2.55k|            continue;
  514|  2.55k|        }
  515|  33.9M|        if (IS_ESC(conf, *p)) {
  ------------------
  |  |   32|  33.9M|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|  33.9M|#define CONF_ESC          32
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 289k, False: 33.6M]
  |  |  ------------------
  ------------------
  516|   289k|            p = scan_esc(conf, p);
  ------------------
  |  |   48|   289k|#define scan_esc(conf,p)        (((IS_EOF((conf),(p)[1]))?((p)+1):((p)+2)))
  |  |  ------------------
  |  |  |  |   31|   289k|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|   289k|#define CONF_EOF          8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (48:35): [True: 435, False: 289k]
  |  |  ------------------
  ------------------
  517|   289k|            continue;
  518|   289k|        }
  519|  33.6M|        if (IS_EOF(conf, *p))
  ------------------
  |  |   31|  33.6M|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   23|  33.6M|#define CONF_EOF          8
  |  |  ------------------
  |  |  |  Branch (31:32): [True: 7.40M, False: 26.2M]
  |  |  ------------------
  ------------------
  520|  7.40M|            return;
  521|  26.2M|        else
  522|  26.2M|            p++;
  523|  33.6M|    }
  524|  7.90M|}
conf_def.c:scan_quote:
  832|  2.55k|{
  833|  2.55k|    int q = *p;
  834|       |
  835|  2.55k|    p++;
  836|  17.3M|    while (!(IS_EOF(conf, *p)) && (*p != q)) {
  ------------------
  |  |   31|  17.3M|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   23|  17.3M|#define CONF_EOF          8
  |  |  ------------------
  ------------------
  |  Branch (836:12): [True: 17.3M, False: 865]
  |  Branch (836:35): [True: 17.3M, False: 1.47k]
  ------------------
  837|  17.3M|        if (IS_ESC(conf, *p)) {
  ------------------
  |  |   32|  17.3M|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|  17.3M|#define CONF_ESC          32
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 108k, False: 17.2M]
  |  |  ------------------
  ------------------
  838|   108k|            p++;
  839|   108k|            if (IS_EOF(conf, *p))
  ------------------
  |  |   31|   108k|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   23|   108k|#define CONF_EOF          8
  |  |  ------------------
  |  |  |  Branch (31:32): [True: 212, False: 108k]
  |  |  ------------------
  ------------------
  840|    212|                return p;
  841|   108k|        }
  842|  17.3M|        p++;
  843|  17.3M|    }
  844|  2.34k|    if (*p == q)
  ------------------
  |  Branch (844:9): [True: 1.47k, False: 865]
  ------------------
  845|  1.47k|        p++;
  846|  2.34k|    return p;
  847|  2.55k|}
conf_def.c:eat_ws:
  799|  7.97M|{
  800|  7.98M|    while (IS_WS(conf, *p) && (!IS_EOF(conf, *p)))
  ------------------
  |  |   34|  15.9M|#define IS_WS(conf,c)          is_keytype(conf, c, CONF_WS)
  |  |  ------------------
  |  |  |  |   17|  7.98M|#define CONF_WS           16
  |  |  ------------------
  |  |  |  Branch (34:32): [True: 9.85k, False: 7.97M]
  |  |  ------------------
  ------------------
                  while (IS_WS(conf, *p) && (!IS_EOF(conf, *p)))
  ------------------
  |  |   31|  9.85k|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   23|  9.85k|#define CONF_EOF          8
  |  |  ------------------
  ------------------
  |  Branch (800:31): [True: 9.85k, False: 0]
  ------------------
  801|  9.85k|        p++;
  802|  7.97M|    return p;
  803|  7.97M|}
conf_def.c:eat_alpha_numeric:
  819|  50.8k|{
  820|  10.0M|    for (;;) {
  821|  10.0M|        if (IS_ESC(conf, *p)) {
  ------------------
  |  |   32|  10.0M|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|  10.0M|#define CONF_ESC          32
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 55.8k, False: 9.97M]
  |  |  ------------------
  ------------------
  822|  55.8k|            p = scan_esc(conf, p);
  ------------------
  |  |   48|  55.8k|#define scan_esc(conf,p)        (((IS_EOF((conf),(p)[1]))?((p)+1):((p)+2)))
  |  |  ------------------
  |  |  |  |   31|  55.8k|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  55.8k|#define CONF_EOF          8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (48:35): [True: 218, False: 55.6k]
  |  |  ------------------
  ------------------
  823|  55.8k|            continue;
  824|  55.8k|        }
  825|  9.97M|        if (!IS_ALNUM_PUNCT(conf, *p))
  ------------------
  |  |   36|  9.97M|#define IS_ALNUM_PUNCT(conf,c) is_keytype(conf, c, CONF_ALNUM_PUNCT)
  |  |  ------------------
  |  |  |  |   26|  9.97M|#define CONF_ALNUM_PUNCT  (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   24|  9.97M|#define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   13|  9.97M|#define CONF_UPPER        2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   14|  9.97M|#define CONF_LOWER        4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM_PUNCT  (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   12|  9.97M|#define CONF_NUMBER       1
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM_PUNCT  (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   15|  9.97M|#define CONF_UNDER        256
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM_PUNCT  (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  9.97M|#define CONF_PUNCT        512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (825:13): [True: 50.8k, False: 9.92M]
  ------------------
  826|  50.8k|            return p;
  827|  9.92M|        p++;
  828|  9.92M|    }
  829|  50.8k|}
conf_def.c:str_copy:
  527|  40.0k|{
  528|  40.0k|    int q, r, rr = 0, to = 0, len = 0;
  529|  40.0k|    char *s, *e, *rp, *p, *rrp, *np, *cp, v;
  530|  40.0k|    BUF_MEM *buf;
  531|       |
  532|  40.0k|    if ((buf = BUF_MEM_new()) == NULL)
  ------------------
  |  Branch (532:9): [True: 0, False: 40.0k]
  ------------------
  533|      0|        return 0;
  534|       |
  535|  40.0k|    len = strlen(from) + 1;
  536|  40.0k|    if (!BUF_MEM_grow(buf, len))
  ------------------
  |  Branch (536:9): [True: 0, False: 40.0k]
  ------------------
  537|      0|        goto err;
  538|       |
  539|  13.4M|    for (;;) {
  540|  13.4M|        if (IS_QUOTE(conf, *from)) {
  ------------------
  |  |   37|  13.4M|#define IS_QUOTE(conf,c)       is_keytype(conf, c, CONF_QUOTE)
  |  |  ------------------
  |  |  |  |   19|  13.4M|#define CONF_QUOTE        64
  |  |  ------------------
  |  |  |  Branch (37:32): [True: 2.19k, False: 13.4M]
  |  |  ------------------
  ------------------
  541|  2.19k|            q = *from;
  542|  2.19k|            from++;
  543|  16.1M|            while (!IS_EOF(conf, *from) && (*from != q)) {
  ------------------
  |  |   31|  32.2M|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   23|  16.1M|#define CONF_EOF          8
  |  |  ------------------
  ------------------
  |  Branch (543:20): [True: 16.1M, False: 591]
  |  Branch (543:44): [True: 16.1M, False: 1.21k]
  ------------------
  544|  16.1M|                if (IS_ESC(conf, *from)) {
  ------------------
  |  |   32|  16.1M|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|  16.1M|#define CONF_ESC          32
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 107k, False: 16.0M]
  |  |  ------------------
  ------------------
  545|   107k|                    from++;
  546|   107k|                    if (IS_EOF(conf, *from))
  ------------------
  |  |   31|   107k|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   23|   107k|#define CONF_EOF          8
  |  |  ------------------
  |  |  |  Branch (31:32): [True: 391, False: 107k]
  |  |  ------------------
  ------------------
  547|    391|                        break;
  548|   107k|                }
  549|  16.1M|                buf->data[to++] = *(from++);
  550|  16.1M|            }
  551|  2.19k|            if (*from == q)
  ------------------
  |  Branch (551:17): [True: 1.21k, False: 982]
  ------------------
  552|  1.21k|                from++;
  553|  13.4M|        } else if (IS_DQUOTE(conf, *from)) {
  ------------------
  |  |   38|  13.4M|#define IS_DQUOTE(conf,c)      is_keytype(conf, c, CONF_DQUOTE)
  |  |  ------------------
  |  |  |  |   20|  13.4M|#define CONF_DQUOTE       1024
  |  |  ------------------
  |  |  |  Branch (38:32): [True: 0, False: 13.4M]
  |  |  ------------------
  ------------------
  554|      0|            q = *from;
  555|      0|            from++;
  556|      0|            while (!IS_EOF(conf, *from)) {
  ------------------
  |  |   31|      0|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   23|      0|#define CONF_EOF          8
  |  |  ------------------
  ------------------
  |  Branch (556:20): [True: 0, False: 0]
  ------------------
  557|      0|                if (*from == q) {
  ------------------
  |  Branch (557:21): [True: 0, False: 0]
  ------------------
  558|      0|                    if (*(from + 1) == q) {
  ------------------
  |  Branch (558:25): [True: 0, False: 0]
  ------------------
  559|      0|                        from++;
  560|      0|                    } else {
  561|      0|                        break;
  562|      0|                    }
  563|      0|                }
  564|      0|                buf->data[to++] = *(from++);
  565|      0|            }
  566|      0|            if (*from == q)
  ------------------
  |  Branch (566:17): [True: 0, False: 0]
  ------------------
  567|      0|                from++;
  568|  13.4M|        } else if (IS_ESC(conf, *from)) {
  ------------------
  |  |   32|  13.4M|#define IS_ESC(conf,c)         is_keytype(conf, c, CONF_ESC)
  |  |  ------------------
  |  |  |  |   18|  13.4M|#define CONF_ESC          32
  |  |  ------------------
  |  |  |  Branch (32:32): [True: 226k, False: 13.2M]
  |  |  ------------------
  ------------------
  569|   226k|            from++;
  570|   226k|            v = *(from++);
  571|   226k|            if (IS_EOF(conf, v))
  ------------------
  |  |   31|   226k|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   23|   226k|#define CONF_EOF          8
  |  |  ------------------
  |  |  |  Branch (31:32): [True: 410, False: 225k]
  |  |  ------------------
  ------------------
  572|    410|                break;
  573|   225k|            else if (v == 'r')
  ------------------
  |  Branch (573:22): [True: 522, False: 225k]
  ------------------
  574|    522|                v = '\r';
  575|   225k|            else if (v == 'n')
  ------------------
  |  Branch (575:22): [True: 276, False: 224k]
  ------------------
  576|    276|                v = '\n';
  577|   224k|            else if (v == 'b')
  ------------------
  |  Branch (577:22): [True: 265, False: 224k]
  ------------------
  578|    265|                v = '\b';
  579|   224k|            else if (v == 't')
  ------------------
  |  Branch (579:22): [True: 505, False: 224k]
  ------------------
  580|    505|                v = '\t';
  581|   225k|            buf->data[to++] = v;
  582|  13.2M|        } else if (IS_EOF(conf, *from))
  ------------------
  |  |   31|  13.2M|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   23|  13.2M|#define CONF_EOF          8
  |  |  ------------------
  |  |  |  Branch (31:32): [True: 39.4k, False: 13.1M]
  |  |  ------------------
  ------------------
  583|  39.4k|            break;
  584|  13.1M|        else if (*from == '$') {
  ------------------
  |  Branch (584:18): [True: 17.4k, False: 13.1M]
  ------------------
  585|  17.4k|            size_t newsize;
  586|       |
  587|       |            /* try to expand it */
  588|  17.4k|            rrp = NULL;
  589|  17.4k|            s = &(from[1]);
  590|  17.4k|            if (*s == '{')
  ------------------
  |  Branch (590:17): [True: 209, False: 17.2k]
  ------------------
  591|    209|                q = '}';
  592|  17.2k|            else if (*s == '(')
  ------------------
  |  Branch (592:22): [True: 269, False: 16.9k]
  ------------------
  593|    269|                q = ')';
  594|  16.9k|            else
  595|  16.9k|                q = 0;
  596|       |
  597|  17.4k|            if (q)
  ------------------
  |  Branch (597:17): [True: 478, False: 16.9k]
  ------------------
  598|    478|                s++;
  599|  17.4k|            cp = section;
  600|  17.4k|            e = np = s;
  601|  2.87M|            while (IS_ALNUM(conf, *e))
  ------------------
  |  |   35|  2.87M|#define IS_ALNUM(conf,c)       is_keytype(conf, c, CONF_ALNUM)
  |  |  ------------------
  |  |  |  |   25|  2.87M|#define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
  |  |  |  |  ------------------
  |  |  |  |  |  |   24|  2.87M|#define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   13|  2.87M|#define CONF_UPPER        2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   14|  2.87M|#define CONF_LOWER        4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
  |  |  |  |  ------------------
  |  |  |  |  |  |   12|  2.87M|#define CONF_NUMBER       1
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
  |  |  |  |  ------------------
  |  |  |  |  |  |   15|  2.87M|#define CONF_UNDER        256
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (35:32): [True: 2.85M, False: 17.4k]
  |  |  ------------------
  ------------------
  602|  2.85M|                e++;
  603|  17.4k|            if ((e[0] == ':') && (e[1] == ':')) {
  ------------------
  |  Branch (603:17): [True: 877, False: 16.5k]
  |  Branch (603:34): [True: 631, False: 246]
  ------------------
  604|    631|                cp = np;
  605|    631|                rrp = e;
  606|    631|                rr = *e;
  607|    631|                *rrp = '\0';
  608|    631|                e += 2;
  609|    631|                np = e;
  610|  2.30k|                while (IS_ALNUM(conf, *e))
  ------------------
  |  |   35|  2.30k|#define IS_ALNUM(conf,c)       is_keytype(conf, c, CONF_ALNUM)
  |  |  ------------------
  |  |  |  |   25|  2.30k|#define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
  |  |  |  |  ------------------
  |  |  |  |  |  |   24|  2.30k|#define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   13|  2.30k|#define CONF_UPPER        2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CONF_ALPHA        (CONF_UPPER|CONF_LOWER)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   14|  2.30k|#define CONF_LOWER        4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
  |  |  |  |  ------------------
  |  |  |  |  |  |   12|  2.30k|#define CONF_NUMBER       1
  |  |  |  |  ------------------
  |  |  |  |               #define CONF_ALNUM        (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
  |  |  |  |  ------------------
  |  |  |  |  |  |   15|  2.30k|#define CONF_UNDER        256
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (35:32): [True: 1.67k, False: 631]
  |  |  ------------------
  ------------------
  611|  1.67k|                    e++;
  612|    631|            }
  613|  17.4k|            r = *e;
  614|  17.4k|            *e = '\0';
  615|  17.4k|            rp = e;
  616|  17.4k|            if (q) {
  ------------------
  |  Branch (616:17): [True: 478, False: 16.9k]
  ------------------
  617|    478|                if (r != q) {
  ------------------
  |  Branch (617:21): [True: 34, False: 444]
  ------------------
  618|     34|                    CONFerr(CONF_F_STR_COPY, CONF_R_NO_CLOSE_BRACE);
  ------------------
  |  |  112|     34|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|     34|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  619|     34|                    goto err;
  620|     34|                }
  621|    444|                e++;
  622|    444|            }
  623|       |            /*-
  624|       |             * So at this point we have
  625|       |             * np which is the start of the name string which is
  626|       |             *   '\0' terminated.
  627|       |             * cp which is the start of the section string which is
  628|       |             *   '\0' terminated.
  629|       |             * e is the 'next point after'.
  630|       |             * r and rr are the chars replaced by the '\0'
  631|       |             * rp and rrp is where 'r' and 'rr' came from.
  632|       |             */
  633|  17.4k|            p = _CONF_get_string(conf, cp, np);
  634|  17.4k|            if (rrp != NULL)
  ------------------
  |  Branch (634:17): [True: 631, False: 16.7k]
  ------------------
  635|    631|                *rrp = rr;
  636|  17.4k|            *rp = r;
  637|  17.4k|            if (p == NULL) {
  ------------------
  |  Branch (637:17): [True: 180, False: 17.2k]
  ------------------
  638|    180|                CONFerr(CONF_F_STR_COPY, CONF_R_VARIABLE_HAS_NO_VALUE);
  ------------------
  |  |  112|    180|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|    180|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  639|    180|                goto err;
  640|    180|            }
  641|  17.2k|            newsize = strlen(p) + buf->length - (e - from);
  642|  17.2k|            if (newsize > MAX_CONF_VALUE_LENGTH) {
  ------------------
  |  |   38|  17.2k|#define MAX_CONF_VALUE_LENGTH       65536
  ------------------
  |  Branch (642:17): [True: 10, False: 17.2k]
  ------------------
  643|     10|                CONFerr(CONF_F_STR_COPY, CONF_R_VARIABLE_EXPANSION_TOO_LONG);
  ------------------
  |  |  112|     10|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|     10|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  644|     10|                goto err;
  645|     10|            }
  646|  17.2k|            if (!BUF_MEM_grow_clean(buf, newsize)) {
  ------------------
  |  Branch (646:17): [True: 0, False: 17.2k]
  ------------------
  647|      0|                CONFerr(CONF_F_STR_COPY, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  648|      0|                goto err;
  649|      0|            }
  650|  31.3M|            while (*p)
  ------------------
  |  Branch (650:20): [True: 31.3M, False: 17.2k]
  ------------------
  651|  31.3M|                buf->data[to++] = *(p++);
  652|       |
  653|       |            /*
  654|       |             * Since we change the pointer 'from', we also have to change the
  655|       |             * perceived length of the string it points at.  /RL
  656|       |             */
  657|  17.2k|            len -= e - from;
  658|  17.2k|            from = e;
  659|       |
  660|       |            /*
  661|       |             * In case there were no braces or parenthesis around the
  662|       |             * variable reference, we have to put back the character that was
  663|       |             * replaced with a '\0'.  /RL
  664|       |             */
  665|  17.2k|            *rp = r;
  666|  17.2k|        } else
  667|  13.1M|            buf->data[to++] = *(from++);
  668|  13.4M|    }
  669|  39.8k|    buf->data[to] = '\0';
  670|  39.8k|    OPENSSL_free(*pto);
  ------------------
  |  |  128|  39.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  39.8k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  39.8k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  671|  39.8k|    *pto = buf->data;
  672|  39.8k|    OPENSSL_free(buf);
  ------------------
  |  |  128|  39.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  39.8k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  39.8k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  673|  39.8k|    return 1;
  674|    224| err:
  675|    224|    BUF_MEM_free(buf);
  676|    224|    return 0;
  677|  40.0k|}
conf_def.c:trim_ws:
  806|  36.9k|{
  807|  36.9k|    char *p = start;
  808|       |
  809|  29.7M|    while (!IS_EOF(conf, *p))
  ------------------
  |  |   31|  29.7M|#define IS_EOF(conf,c)         is_keytype(conf, c, CONF_EOF)
  |  |  ------------------
  |  |  |  |   23|  29.7M|#define CONF_EOF          8
  |  |  ------------------
  ------------------
  |  Branch (809:12): [True: 29.7M, False: 36.9k]
  ------------------
  810|  29.7M|        p++;
  811|  36.9k|    p--;
  812|  37.9k|    while ((p >= start) && IS_WS(conf, *p))
  ------------------
  |  |   34|  14.6k|#define IS_WS(conf,c)          is_keytype(conf, c, CONF_WS)
  |  |  ------------------
  |  |  |  |   17|  14.6k|#define CONF_WS           16
  |  |  ------------------
  |  |  |  Branch (34:32): [True: 959, False: 13.7k]
  |  |  ------------------
  ------------------
  |  Branch (812:12): [True: 14.6k, False: 23.2k]
  ------------------
  813|    959|        p--;
  814|  36.9k|    p++;
  815|  36.9k|    *p = '\0';
  816|  36.9k|}
conf_def.c:process_include:
  687|  8.29k|{
  688|  8.29k|    struct stat st = { 0 };
  689|  8.29k|    BIO *next;
  690|       |
  691|  8.29k|    if (stat(include, &st) < 0) {
  ------------------
  |  Branch (691:9): [True: 1.32k, False: 6.97k]
  ------------------
  692|  1.32k|        SYSerr(SYS_F_STAT, errno);
  ------------------
  |  |  101|  1.32k|# define SYSerr(f,r)  ERR_PUT_error(ERR_LIB_SYS,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|  1.32k|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  693|  1.32k|        ERR_add_error_data(1, include);
  694|       |        /* missing include file is not fatal error */
  695|  1.32k|        return NULL;
  696|  1.32k|    }
  697|       |
  698|  6.97k|    if (S_ISDIR(st.st_mode)) {
  699|  6.95k|        if (*dirctx != NULL) {
  ------------------
  |  Branch (699:13): [True: 0, False: 6.95k]
  ------------------
  700|      0|            CONFerr(CONF_F_PROCESS_INCLUDE,
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  701|      0|                    CONF_R_RECURSIVE_DIRECTORY_INCLUDE);
  702|      0|            ERR_add_error_data(1, include);
  703|      0|            return NULL;
  704|      0|        }
  705|       |        /* a directory, load its contents */
  706|  6.95k|        if ((next = get_next_file(include, dirctx)) != NULL)
  ------------------
  |  Branch (706:13): [True: 6.45k, False: 500]
  ------------------
  707|  6.45k|            *dirpath = include;
  708|  6.95k|        return next;
  709|  6.95k|    }
  710|       |
  711|     19|    next = BIO_new_file(include, "r");
  712|     19|    return next;
  713|  6.97k|}

ERR_load_CONF_strings:
   87|      2|{
   88|      2|#ifndef OPENSSL_NO_ERR
   89|      2|    if (ERR_func_error_string(CONF_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (89:9): [True: 2, False: 0]
  ------------------
   90|      2|        ERR_load_strings_const(CONF_str_functs);
   91|      2|        ERR_load_strings_const(CONF_str_reasons);
   92|      2|    }
   93|      2|#endif
   94|      2|    return 1;
   95|      2|}

CONF_set_nconf:
   26|    865|{
   27|    865|    if (default_CONF_method == NULL)
  ------------------
  |  Branch (27:9): [True: 1, False: 864]
  ------------------
   28|      1|        default_CONF_method = NCONF_default();
   29|       |
   30|    865|    default_CONF_method->init(conf);
   31|    865|    conf->data = hash;
   32|    865|}
CONF_free:
  140|    865|{
  141|    865|    CONF ctmp;
  142|    865|    CONF_set_nconf(&ctmp, conf);
  143|    865|    NCONF_free_data(&ctmp);
  144|    865|}
NCONF_new:
  178|  2.49k|{
  179|  2.49k|    CONF *ret;
  180|       |
  181|  2.49k|    if (meth == NULL)
  ------------------
  |  Branch (181:9): [True: 2.49k, False: 0]
  ------------------
  182|  2.49k|        meth = NCONF_default();
  183|       |
  184|  2.49k|    ret = meth->create(meth);
  185|  2.49k|    if (ret == NULL) {
  ------------------
  |  Branch (185:9): [True: 0, False: 2.49k]
  ------------------
  186|      0|        CONFerr(CONF_F_NCONF_NEW, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  187|      0|        return NULL;
  188|      0|    }
  189|       |
  190|  2.49k|    return ret;
  191|  2.49k|}
NCONF_free:
  194|  2.49k|{
  195|  2.49k|    if (conf == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 2.49k]
  ------------------
  196|      0|        return;
  197|  2.49k|    conf->meth->destroy(conf);
  198|  2.49k|}
NCONF_free_data:
  201|    865|{
  202|    865|    if (conf == NULL)
  ------------------
  |  Branch (202:9): [True: 0, False: 865]
  ------------------
  203|      0|        return;
  204|    865|    conf->meth->destroy_data(conf);
  205|    865|}
NCONF_load_bio:
  233|  2.49k|{
  234|  2.49k|    if (conf == NULL) {
  ------------------
  |  Branch (234:9): [True: 0, False: 2.49k]
  ------------------
  235|      0|        CONFerr(CONF_F_NCONF_LOAD_BIO, CONF_R_NO_CONF);
  ------------------
  |  |  112|      0|# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  236|      0|        return 0;
  237|      0|    }
  238|       |
  239|  2.49k|    return conf->meth->load_bio(conf, bp, eline);
  240|  2.49k|}

CONF_modules_unload:
  360|      2|{
  361|      2|    int i;
  362|      2|    CONF_MODULE *md;
  363|      2|    CONF_modules_finish();
  364|       |    /* unload modules in reverse order */
  365|      2|    for (i = sk_CONF_MODULE_num(supported_modules) - 1; i >= 0; i--) {
  ------------------
  |  Branch (365:57): [True: 0, False: 2]
  ------------------
  366|      0|        md = sk_CONF_MODULE_value(supported_modules, i);
  367|       |        /* If static or in use and 'all' not set ignore it */
  368|      0|        if (((md->links > 0) || !md->dso) && !all)
  ------------------
  |  Branch (368:14): [True: 0, False: 0]
  |  Branch (368:33): [True: 0, False: 0]
  |  Branch (368:46): [True: 0, False: 0]
  ------------------
  369|      0|            continue;
  370|       |        /* Since we're working in reverse this is OK */
  371|      0|        (void)sk_CONF_MODULE_delete(supported_modules, i);
  372|      0|        module_free(md);
  373|      0|    }
  374|      2|    if (sk_CONF_MODULE_num(supported_modules) == 0) {
  ------------------
  |  Branch (374:9): [True: 0, False: 2]
  ------------------
  375|      0|        sk_CONF_MODULE_free(supported_modules);
  376|      0|        supported_modules = NULL;
  377|      0|    }
  378|      2|}
CONF_modules_finish:
  391|      4|{
  392|      4|    CONF_IMODULE *imod;
  393|      4|    while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  ------------------
  |  Branch (393:12): [True: 0, False: 4]
  ------------------
  394|      0|        imod = sk_CONF_IMODULE_pop(initialized_modules);
  395|      0|        module_finish(imod);
  396|      0|    }
  397|      4|    sk_CONF_IMODULE_free(initialized_modules);
  398|      4|    initialized_modules = NULL;
  399|      4|}
conf_modules_free_int:
  427|      2|{
  428|      2|    CONF_modules_finish();
  429|      2|    CONF_modules_unload(1);
  430|      2|}

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

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

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

ossl_ctype_check:
  253|  1.11k|{
  254|  1.11k|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|  1.11k|    const int a = ossl_toascii(c);
  ------------------
  |  |   53|  1.11k|#  define ossl_toascii(c)       (c)
  ------------------
  256|       |
  257|  1.11k|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 1.11k, False: 0]
  |  Branch (257:22): [True: 1.11k, False: 0]
  |  Branch (257:33): [True: 0, False: 1.11k]
  ------------------
  258|  1.11k|}

ERR_load_DH_strings:
   94|      2|{
   95|      2|#ifndef OPENSSL_NO_ERR
   96|      2|    if (ERR_func_error_string(DH_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (96:9): [True: 2, False: 0]
  ------------------
   97|      2|        ERR_load_strings_const(DH_str_functs);
   98|      2|        ERR_load_strings_const(DH_str_reasons);
   99|      2|    }
  100|      2|#endif
  101|      2|    return 1;
  102|      2|}

ERR_load_DSA_strings:
   70|      2|{
   71|      2|#ifndef OPENSSL_NO_ERR
   72|      2|    if (ERR_func_error_string(DSA_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (72:9): [True: 2, False: 0]
  ------------------
   73|      2|        ERR_load_strings_const(DSA_str_functs);
   74|      2|        ERR_load_strings_const(DSA_str_reasons);
   75|      2|    }
   76|      2|#endif
   77|      2|    return 1;
   78|      2|}

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

ERR_load_EC_strings:
  387|      2|{
  388|      2|#ifndef OPENSSL_NO_ERR
  389|      2|    if (ERR_func_error_string(EC_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (389:9): [True: 2, False: 0]
  ------------------
  390|      2|        ERR_load_strings_const(EC_str_functs);
  391|      2|        ERR_load_strings_const(EC_str_reasons);
  392|      2|    }
  393|      2|#endif
  394|      2|    return 1;
  395|      2|}

ERR_load_ENGINE_strings:
  146|      2|{
  147|      2|#ifndef OPENSSL_NO_ERR
  148|      2|    if (ERR_func_error_string(ENGINE_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (148:9): [True: 2, False: 0]
  ------------------
  149|      2|        ERR_load_strings_const(ENGINE_str_functs);
  150|      2|        ERR_load_strings_const(ENGINE_str_reasons);
  151|      2|    }
  152|      2|#endif
  153|      2|    return 1;
  154|      2|}

engine_cleanup_int:
  169|      2|{
  170|      2|    if (int_cleanup_check(0)) {
  ------------------
  |  Branch (170:9): [True: 0, False: 2]
  ------------------
  171|      0|        sk_ENGINE_CLEANUP_ITEM_pop_free(cleanup_stack,
  172|      0|                                        engine_cleanup_cb_free);
  173|      0|        cleanup_stack = NULL;
  174|      0|    }
  175|      2|    CRYPTO_THREAD_lock_free(global_engine_lock);
  176|      2|    global_engine_lock = NULL;
  177|      2|}
eng_lib.c:int_cleanup_check:
  117|      2|{
  118|      2|    if (cleanup_stack)
  ------------------
  |  Branch (118:9): [True: 0, False: 2]
  ------------------
  119|      0|        return 1;
  120|      2|    if (!create)
  ------------------
  |  Branch (120:9): [True: 2, False: 0]
  ------------------
  121|      2|        return 0;
  122|      0|    cleanup_stack = sk_ENGINE_CLEANUP_ITEM_new_null();
  123|      0|    return (cleanup_stack ? 1 : 0);
  ------------------
  |  Branch (123:13): [True: 0, False: 0]
  ------------------
  124|      2|}

err_cleanup:
  321|      2|{
  322|      2|    if (set_err_thread_local != 0)
  ------------------
  |  Branch (322:9): [True: 2, False: 0]
  ------------------
  323|      2|        CRYPTO_THREAD_cleanup_local(&err_thread_local);
  324|      2|    CRYPTO_THREAD_lock_free(err_string_lock);
  325|      2|    err_string_lock = NULL;
  326|      2|#ifndef OPENSSL_NO_ERR
  327|      2|    lh_ERR_STRING_DATA_free(int_error_hash);
  328|      2|    int_error_hash = NULL;
  329|      2|#endif
  330|      2|}
ERR_load_ERR_strings:
  359|    118|{
  360|    118|#ifndef OPENSSL_NO_ERR
  361|    118|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  119|    118|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 118, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (361:9): [True: 0, False: 118]
  ------------------
  362|      0|        return 0;
  363|       |
  364|    118|    err_load_strings(ERR_str_libraries);
  365|    118|    err_load_strings(ERR_str_reasons);
  366|    118|    err_patch(ERR_LIB_SYS, ERR_str_functs);
  ------------------
  |  |   55|    118|# define ERR_LIB_SYS             2
  ------------------
  367|    118|    err_load_strings(ERR_str_functs);
  368|    118|    build_SYS_str_reasons();
  369|    118|#endif
  370|    118|    return 1;
  371|    118|}
ERR_load_strings_const:
  387|    116|{
  388|    116|#ifndef OPENSSL_NO_ERR
  389|    116|    if (ERR_load_ERR_strings() == 0)
  ------------------
  |  Branch (389:9): [True: 0, False: 116]
  ------------------
  390|      0|        return 0;
  391|    116|    err_load_strings(str);
  392|    116|#endif
  393|       |
  394|    116|    return 1;
  395|    116|}
ERR_put_error:
  424|   170k|{
  425|   170k|    ERR_STATE *es;
  426|       |
  427|       |#ifdef _OSD_POSIX
  428|       |    /*
  429|       |     * In the BS2000-OSD POSIX subsystem, the compiler generates path names
  430|       |     * in the form "*POSIX(/etc/passwd)". This dirty hack strips them to
  431|       |     * something sensible. @@@ We shouldn't modify a const string, though.
  432|       |     */
  433|       |    if (strncmp(file, "*POSIX(", sizeof("*POSIX(") - 1) == 0) {
  434|       |        char *end;
  435|       |
  436|       |        /* Skip the "*POSIX(" prefix */
  437|       |        file += sizeof("*POSIX(") - 1;
  438|       |        end = &file[strlen(file) - 1];
  439|       |        if (*end == ')')
  440|       |            *end = '\0';
  441|       |        /* Optional: use the basename of the path only. */
  442|       |        if ((end = strrchr(file, '/')) != NULL)
  443|       |            file = &end[1];
  444|       |    }
  445|       |#endif
  446|   170k|    es = ERR_get_state();
  447|   170k|    if (es == NULL)
  ------------------
  |  Branch (447:9): [True: 0, False: 170k]
  ------------------
  448|      0|        return;
  449|       |
  450|   170k|    es->top = (es->top + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   42|   170k|# define ERR_NUM_ERRORS  16
  ------------------
  451|   170k|    if (es->top == es->bottom)
  ------------------
  |  Branch (451:9): [True: 168k, False: 2.71k]
  ------------------
  452|   168k|        es->bottom = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   42|   168k|# define ERR_NUM_ERRORS  16
  ------------------
  453|   170k|    es->err_flags[es->top] = 0;
  454|   170k|    es->err_buffer[es->top] = ERR_PACK(lib, func, reason);
  ------------------
  |  |  138|   170k|# define ERR_PACK(l,f,r) ( \
  |  |  139|   170k|        (((unsigned int)(l) & 0x0FF) << 24L) | \
  |  |  140|   170k|        (((unsigned int)(f) & 0xFFF) << 12L) | \
  |  |  141|   170k|        (((unsigned int)(r) & 0xFFF)       ) )
  ------------------
  455|   170k|    es->err_file[es->top] = file;
  456|   170k|    es->err_line[es->top] = line;
  457|   170k|    err_clear_data(es, es->top);
  ------------------
  |  |  272|   170k|        do { \
  |  |  273|   170k|            if ((p)->err_data_flags[i] & ERR_TXT_MALLOCED) {\
  |  |  ------------------
  |  |  |  |   36|   170k|# define ERR_TXT_MALLOCED        0x01
  |  |  ------------------
  |  |  |  Branch (273:17): [True: 84.4k, False: 86.4k]
  |  |  ------------------
  |  |  274|  84.4k|                OPENSSL_free((p)->err_data[i]); \
  |  |  ------------------
  |  |  |  |  128|  84.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  84.4k|#  define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  84.4k|#  define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  275|  84.4k|                (p)->err_data[i] = NULL; \
  |  |  276|  84.4k|            } \
  |  |  277|   170k|            (p)->err_data_flags[i] = 0; \
  |  |  278|   170k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (278:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  458|   170k|}
ERR_clear_error:
  461|  2.49k|{
  462|  2.49k|    int i;
  463|  2.49k|    ERR_STATE *es;
  464|       |
  465|  2.49k|    es = ERR_get_state();
  466|  2.49k|    if (es == NULL)
  ------------------
  |  Branch (466:9): [True: 0, False: 2.49k]
  ------------------
  467|      0|        return;
  468|       |
  469|  42.3k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   42|  42.3k|# define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (469:17): [True: 39.8k, False: 2.49k]
  ------------------
  470|  39.8k|        err_clear(es, i);
  ------------------
  |  |  281|  39.8k|        do { \
  |  |  282|  39.8k|            err_clear_data(p, i); \
  |  |  ------------------
  |  |  |  |  272|  39.8k|        do { \
  |  |  |  |  273|  39.8k|            if ((p)->err_data_flags[i] & ERR_TXT_MALLOCED) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  39.8k|# define ERR_TXT_MALLOCED        0x01
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (273:17): [True: 2.10k, False: 37.7k]
  |  |  |  |  ------------------
  |  |  |  |  274|  2.10k|                OPENSSL_free((p)->err_data[i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  128|  2.10k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  2.10k|#  define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  2.10k|#  define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  275|  2.10k|                (p)->err_data[i] = NULL; \
  |  |  |  |  276|  2.10k|            } \
  |  |  |  |  277|  39.8k|            (p)->err_data_flags[i] = 0; \
  |  |  |  |  278|  39.8k|        } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (278:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  283|  39.8k|            (p)->err_flags[i] = 0; \
  |  |  284|  39.8k|            (p)->err_buffer[i] = 0; \
  |  |  285|  39.8k|            (p)->err_file[i] = NULL; \
  |  |  286|  39.8k|            (p)->err_line[i] = -1; \
  |  |  287|  39.8k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (287:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  471|  39.8k|    }
  472|  2.49k|    es->top = es->bottom = 0;
  473|  2.49k|}
ERR_func_error_string:
  676|     58|{
  677|     58|#ifndef OPENSSL_NO_ERR
  678|     58|    ERR_STRING_DATA d, *p;
  679|     58|    unsigned long l, f;
  680|       |
  681|     58|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  119|     58|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 58, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (681:9): [True: 0, False: 58]
  ------------------
  682|      0|        return NULL;
  683|      0|    }
  684|       |
  685|     58|    l = ERR_GET_LIB(e);
  ------------------
  |  |  142|     58|# define ERR_GET_LIB(l)          (int)(((l) >> 24L) & 0x0FFL)
  ------------------
  686|     58|    f = ERR_GET_FUNC(e);
  ------------------
  |  |  143|     58|# define ERR_GET_FUNC(l)         (int)(((l) >> 12L) & 0xFFFL)
  ------------------
  687|     58|    d.error = ERR_PACK(l, f, 0);
  ------------------
  |  |  138|     58|# define ERR_PACK(l,f,r) ( \
  |  |  139|     58|        (((unsigned int)(l) & 0x0FF) << 24L) | \
  |  |  140|     58|        (((unsigned int)(f) & 0xFFF) << 12L) | \
  |  |  141|     58|        (((unsigned int)(r) & 0xFFF)       ) )
  ------------------
  688|     58|    p = int_err_get_item(&d);
  689|     58|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (689:13): [True: 58, False: 0]
  ------------------
  690|       |#else
  691|       |    return NULL;
  692|       |#endif
  693|     58|}
err_delete_thread_state:
  720|      2|{
  721|      2|    ERR_STATE *state = CRYPTO_THREAD_get_local(&err_thread_local);
  722|      2|    if (state == NULL)
  ------------------
  |  Branch (722:9): [True: 0, False: 2]
  ------------------
  723|      0|        return;
  724|       |
  725|      2|    CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  726|      2|    ERR_STATE_free(state);
  727|      2|}
ERR_get_state:
  748|   259k|{
  749|   259k|    ERR_STATE *state;
  750|   259k|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   75|   259k|# define get_last_sys_error()    errno
  ------------------
  751|       |
  752|   259k|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   28|   259k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (752:9): [True: 0, False: 259k]
  ------------------
  753|      0|        return NULL;
  754|       |
  755|   259k|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  119|   259k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 259k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (755:9): [True: 0, False: 259k]
  ------------------
  756|      0|        return NULL;
  757|       |
  758|   259k|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  759|   259k|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (759:9): [True: 0, False: 259k]
  ------------------
  760|      0|        return NULL;
  761|       |
  762|   259k|    if (state == NULL) {
  ------------------
  |  Branch (762:9): [True: 2, False: 259k]
  ------------------
  763|      2|        if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (763:13): [True: 0, False: 2]
  ------------------
  764|      0|            return NULL;
  765|       |
  766|      2|        if ((state = OPENSSL_zalloc(sizeof(*state))) == NULL) {
  ------------------
  |  |  120|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      2|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      2|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (766:13): [True: 0, False: 2]
  ------------------
  767|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  768|      0|            return NULL;
  769|      0|        }
  770|       |
  771|      2|        if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE)
  ------------------
  |  |   32|      2|# define OPENSSL_INIT_THREAD_ERR_STATE       0x02
  ------------------
  |  Branch (771:13): [True: 0, False: 2]
  ------------------
  772|      2|                || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
  ------------------
  |  Branch (772:20): [True: 0, False: 2]
  ------------------
  773|      0|            ERR_STATE_free(state);
  774|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  775|      0|            return NULL;
  776|      0|        }
  777|       |
  778|       |        /* Ignore failures from these */
  779|      2|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  357|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  780|      2|    }
  781|       |
  782|   259k|    set_sys_error(saveerrno);
  ------------------
  |  |   77|   259k|# define set_sys_error(e)        errno=(e)
  ------------------
  783|   259k|    return state;
  784|   259k|}
ERR_add_error_data:
  871|  86.5k|{
  872|  86.5k|    va_list args;
  873|  86.5k|    va_start(args, num);
  874|  86.5k|    ERR_add_error_vdata(num, args);
  875|  86.5k|    va_end(args);
  876|  86.5k|}
ERR_add_error_vdata:
  879|  86.5k|{
  880|  86.5k|    int i, n, s;
  881|  86.5k|    char *str, *p, *a;
  882|       |
  883|  86.5k|    s = 80;
  884|  86.5k|    if ((str = OPENSSL_malloc(s + 1)) == NULL) {
  ------------------
  |  |  118|  86.5k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  86.5k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  86.5k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (884:9): [True: 0, False: 86.5k]
  ------------------
  885|       |        /* ERRerr(ERR_F_ERR_ADD_ERROR_VDATA, ERR_R_MALLOC_FAILURE); */
  886|      0|        return;
  887|      0|    }
  888|  86.5k|    str[0] = '\0';
  889|       |
  890|  86.5k|    n = 0;
  891|   511k|    for (i = 0; i < num; i++) {
  ------------------
  |  Branch (891:17): [True: 424k, False: 86.5k]
  ------------------
  892|   424k|        a = va_arg(args, char *);
  893|   424k|        if (a == NULL)
  ------------------
  |  Branch (893:13): [True: 0, False: 424k]
  ------------------
  894|      0|            a = "<NULL>";
  895|   424k|        n += strlen(a);
  896|   424k|        if (n > s) {
  ------------------
  |  Branch (896:13): [True: 84.4k, False: 340k]
  ------------------
  897|  84.4k|            s = n + 20;
  898|  84.4k|            p = OPENSSL_realloc(str, s + 1);
  ------------------
  |  |  122|  84.4k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  84.4k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  84.4k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  899|  84.4k|            if (p == NULL) {
  ------------------
  |  Branch (899:17): [True: 0, False: 84.4k]
  ------------------
  900|      0|                OPENSSL_free(str);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  901|      0|                return;
  902|      0|            }
  903|  84.4k|            str = p;
  904|  84.4k|        }
  905|   424k|        OPENSSL_strlcat(str, a, (size_t)s + 1);
  906|   424k|    }
  907|  86.5k|    if (!err_set_error_data_int(str, ERR_TXT_MALLOCED | ERR_TXT_STRING))
  ------------------
  |  |   36|  86.5k|# define ERR_TXT_MALLOCED        0x01
  ------------------
                  if (!err_set_error_data_int(str, ERR_TXT_MALLOCED | ERR_TXT_STRING))
  ------------------
  |  |   37|  86.5k|# define ERR_TXT_STRING          0x02
  ------------------
  |  Branch (907:9): [True: 0, False: 86.5k]
  ------------------
  908|      0|        OPENSSL_free(str);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  909|  86.5k|}
err.c:do_err_strings_init:
  302|      2|{
  303|      2|    if (!OPENSSL_init_crypto(0, NULL))
  ------------------
  |  Branch (303:9): [True: 0, False: 2]
  ------------------
  304|      0|        return 0;
  305|      2|    err_string_lock = CRYPTO_THREAD_lock_new();
  306|      2|    if (err_string_lock == NULL)
  ------------------
  |  Branch (306:9): [True: 0, False: 2]
  ------------------
  307|      0|        return 0;
  308|      2|#ifndef OPENSSL_NO_ERR
  309|      2|    int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
  310|      2|                                            err_string_data_cmp);
  311|      2|    if (int_error_hash == NULL) {
  ------------------
  |  Branch (311:9): [True: 0, False: 2]
  ------------------
  312|      0|        CRYPTO_THREAD_lock_free(err_string_lock);
  313|      0|        err_string_lock = NULL;
  314|      0|        return 0;
  315|      0|    }
  316|      2|#endif
  317|      2|    return 1;
  318|      2|}
err.c:err_string_data_hash:
  167|  15.2k|{
  168|  15.2k|    unsigned long ret, l;
  169|       |
  170|  15.2k|    l = a->error;
  171|  15.2k|    ret = l ^ ERR_GET_LIB(l) ^ ERR_GET_FUNC(l);
  ------------------
  |  |  142|  15.2k|# define ERR_GET_LIB(l)          (int)(((l) >> 24L) & 0x0FFL)
  ------------------
                  ret = l ^ ERR_GET_LIB(l) ^ ERR_GET_FUNC(l);
  ------------------
  |  |  143|  15.2k|# define ERR_GET_FUNC(l)         (int)(((l) >> 12L) & 0xFFFL)
  ------------------
  172|  15.2k|    return (ret ^ ret % 19 * 13);
  173|  15.2k|}
err.c:err_string_data_cmp:
  177|  10.5k|{
  178|  10.5k|    if (a->error == b->error)
  ------------------
  |  Branch (178:9): [True: 10.3k, False: 246]
  ------------------
  179|  10.3k|        return 0;
  180|    246|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (180:12): [True: 150, False: 96]
  ------------------
  181|  10.5k|}
err.c:err_load_strings:
  348|    472|{
  349|    472|    CRYPTO_THREAD_write_lock(err_string_lock);
  350|  15.6k|    for (; str->error; str++)
  ------------------
  |  Branch (350:12): [True: 15.1k, False: 472]
  ------------------
  351|  15.1k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  352|  15.1k|                                       (ERR_STRING_DATA *)str);
  353|    472|    CRYPTO_THREAD_unlock(err_string_lock);
  354|    472|    return 1;
  355|    472|}
err.c:err_patch:
  337|    118|{
  338|    118|    unsigned long plib = ERR_PACK(lib, 0, 0);
  ------------------
  |  |  138|    118|# define ERR_PACK(l,f,r) ( \
  |  |  139|    118|        (((unsigned int)(l) & 0x0FF) << 24L) | \
  |  |  140|    118|        (((unsigned int)(f) & 0xFFF) << 12L) | \
  |  |  141|    118|        (((unsigned int)(r) & 0xFFF)       ) )
  ------------------
  339|       |
  340|  2.83k|    for (; str->error != 0; str++)
  ------------------
  |  Branch (340:12): [True: 2.71k, False: 118]
  ------------------
  341|  2.71k|        str->error |= plib;
  342|    118|}
err.c:build_SYS_str_reasons:
  210|    118|{
  211|       |    /* OPENSSL_malloc cannot be used here, use static storage instead */
  212|    118|    static char strerror_pool[SPACE_SYS_STR_REASONS];
  213|    118|    char *cur = strerror_pool;
  214|    118|    size_t cnt = 0;
  215|    118|    static int init = 1;
  216|    118|    int i;
  217|    118|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   75|    118|# define get_last_sys_error()    errno
  ------------------
  218|       |
  219|    118|    CRYPTO_THREAD_write_lock(err_string_lock);
  220|    118|    if (!init) {
  ------------------
  |  Branch (220:9): [True: 116, False: 2]
  ------------------
  221|    116|        CRYPTO_THREAD_unlock(err_string_lock);
  222|    116|        return;
  223|    116|    }
  224|       |
  225|    256|    for (i = 1; i <= NUM_SYS_STR_REASONS; i++) {
  ------------------
  |  |  196|    256|# define NUM_SYS_STR_REASONS 127
  ------------------
  |  Branch (225:17): [True: 254, False: 2]
  ------------------
  226|    254|        ERR_STRING_DATA *str = &SYS_str_reasons[i - 1];
  227|       |
  228|    254|        str->error = ERR_PACK(ERR_LIB_SYS, 0, i);
  ------------------
  |  |  138|    254|# define ERR_PACK(l,f,r) ( \
  |  |  139|    254|        (((unsigned int)(l) & 0x0FF) << 24L) | \
  |  |  140|    254|        (((unsigned int)(f) & 0xFFF) << 12L) | \
  |  |  141|    254|        (((unsigned int)(r) & 0xFFF)       ) )
  ------------------
  229|       |        /*
  230|       |         * If we have used up all the space in strerror_pool,
  231|       |         * there's no point in calling openssl_strerror_r()
  232|       |         */
  233|    254|        if (str->string == NULL && cnt < sizeof(strerror_pool)) {
  ------------------
  |  Branch (233:13): [True: 254, False: 0]
  |  Branch (233:36): [True: 254, False: 0]
  ------------------
  234|    254|            if (openssl_strerror_r(i, cur, sizeof(strerror_pool) - cnt)) {
  ------------------
  |  Branch (234:17): [True: 250, False: 4]
  ------------------
  235|    250|                size_t l = strlen(cur);
  236|       |
  237|    250|                str->string = cur;
  238|    250|                cnt += l;
  239|    250|                cur += l;
  240|       |
  241|       |                /*
  242|       |                 * VMS has an unusual quirk of adding spaces at the end of
  243|       |                 * some (most? all?) messages. Lets trim them off.
  244|       |                 */
  245|    250|                while (cur > strerror_pool && ossl_isspace(cur[-1])) {
  ------------------
  |  |   76|    250|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   27|    250|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (76:33): [True: 0, False: 250]
  |  |  ------------------
  ------------------
  |  Branch (245:24): [True: 250, False: 0]
  ------------------
  246|      0|                    cur--;
  247|      0|                    cnt--;
  248|      0|                }
  249|    250|                *cur++ = '\0';
  250|    250|                cnt++;
  251|    250|            }
  252|    254|        }
  253|    254|        if (str->string == NULL)
  ------------------
  |  Branch (253:13): [True: 4, False: 250]
  ------------------
  254|      4|            str->string = "unknown";
  255|    254|    }
  256|       |
  257|       |    /*
  258|       |     * Now we still have SYS_str_reasons[NUM_SYS_STR_REASONS] = {0, NULL}, as
  259|       |     * required by ERR_load_strings.
  260|       |     */
  261|       |
  262|      2|    init = 0;
  263|       |
  264|      2|    CRYPTO_THREAD_unlock(err_string_lock);
  265|       |    /* openssl_strerror_r could change errno, but we want to preserve it */
  266|      2|    set_sys_error(saveerrno);
  ------------------
  |  |   77|      2|# define set_sys_error(e)        errno=(e)
  ------------------
  267|      2|    err_load_strings(SYS_str_reasons);
  268|      2|}
err.c:int_err_get_item:
  184|     58|{
  185|     58|    ERR_STRING_DATA *p = NULL;
  186|       |
  187|     58|    CRYPTO_THREAD_read_lock(err_string_lock);
  188|     58|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  189|     58|    CRYPTO_THREAD_unlock(err_string_lock);
  190|       |
  191|     58|    return p;
  192|     58|}
err.c:ERR_STATE_free:
  290|      2|{
  291|      2|    int i;
  292|       |
  293|      2|    if (s == NULL)
  ------------------
  |  Branch (293:9): [True: 0, False: 2]
  ------------------
  294|      0|        return;
  295|     34|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   42|     34|# define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (295:17): [True: 32, False: 2]
  ------------------
  296|     32|        err_clear_data(s, i);
  ------------------
  |  |  272|     32|        do { \
  |  |  273|     32|            if ((p)->err_data_flags[i] & ERR_TXT_MALLOCED) {\
  |  |  ------------------
  |  |  |  |   36|     32|# define ERR_TXT_MALLOCED        0x01
  |  |  ------------------
  |  |  |  Branch (273:17): [True: 0, False: 32]
  |  |  ------------------
  |  |  274|      0|                OPENSSL_free((p)->err_data[i]); \
  |  |  ------------------
  |  |  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  275|      0|                (p)->err_data[i] = NULL; \
  |  |  276|      0|            } \
  |  |  277|     32|            (p)->err_data_flags[i] = 0; \
  |  |  278|     32|        } while (0)
  |  |  ------------------
  |  |  |  Branch (278:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  297|     32|    }
  298|      2|    OPENSSL_free(s);
  ------------------
  |  |  128|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      2|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      2|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  299|      2|}
err.c:err_do_init:
  742|      2|{
  743|      2|    set_err_thread_local = 1;
  744|      2|    return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
  745|      2|}
err.c:err_set_error_data_int:
  844|  86.5k|{
  845|  86.5k|    ERR_STATE *es;
  846|  86.5k|    int i;
  847|       |
  848|  86.5k|    es = ERR_get_state();
  849|  86.5k|    if (es == NULL)
  ------------------
  |  Branch (849:9): [True: 0, False: 86.5k]
  ------------------
  850|      0|        return 0;
  851|       |
  852|  86.5k|    i = es->top;
  853|       |
  854|  86.5k|    err_clear_data(es, i);
  ------------------
  |  |  272|  86.5k|        do { \
  |  |  273|  86.5k|            if ((p)->err_data_flags[i] & ERR_TXT_MALLOCED) {\
  |  |  ------------------
  |  |  |  |   36|  86.5k|# define ERR_TXT_MALLOCED        0x01
  |  |  ------------------
  |  |  |  Branch (273:17): [True: 0, False: 86.5k]
  |  |  ------------------
  |  |  274|      0|                OPENSSL_free((p)->err_data[i]); \
  |  |  ------------------
  |  |  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  275|      0|                (p)->err_data[i] = NULL; \
  |  |  276|      0|            } \
  |  |  277|  86.5k|            (p)->err_data_flags[i] = 0; \
  |  |  278|  86.5k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (278:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  855|  86.5k|    es->err_data[i] = data;
  856|  86.5k|    es->err_data_flags[i] = flags;
  857|       |
  858|  86.5k|    return 1;
  859|  86.5k|}

err_load_crypto_strings_int:
   43|      2|{
   44|      2|    if (
   45|      2|#ifndef OPENSSL_NO_ERR
   46|      2|        ERR_load_ERR_strings() == 0 ||    /* include error strings for SYSerr */
  ------------------
  |  Branch (46:9): [True: 0, False: 2]
  ------------------
   47|      2|        ERR_load_BN_strings() == 0 ||
  ------------------
  |  Branch (47:9): [True: 0, False: 2]
  ------------------
   48|      2|# ifndef OPENSSL_NO_RSA
   49|      2|        ERR_load_RSA_strings() == 0 ||
  ------------------
  |  Branch (49:9): [True: 0, False: 2]
  ------------------
   50|      2|# endif
   51|      2|# ifndef OPENSSL_NO_DH
   52|      2|        ERR_load_DH_strings() == 0 ||
  ------------------
  |  Branch (52:9): [True: 0, False: 2]
  ------------------
   53|      2|# endif
   54|      2|        ERR_load_EVP_strings() == 0 ||
  ------------------
  |  Branch (54:9): [True: 0, False: 2]
  ------------------
   55|      2|        ERR_load_BUF_strings() == 0 ||
  ------------------
  |  Branch (55:9): [True: 0, False: 2]
  ------------------
   56|      2|        ERR_load_OBJ_strings() == 0 ||
  ------------------
  |  Branch (56:9): [True: 0, False: 2]
  ------------------
   57|      2|        ERR_load_PEM_strings() == 0 ||
  ------------------
  |  Branch (57:9): [True: 0, False: 2]
  ------------------
   58|      2|# ifndef OPENSSL_NO_DSA
   59|      2|        ERR_load_DSA_strings() == 0 ||
  ------------------
  |  Branch (59:9): [True: 0, False: 2]
  ------------------
   60|      2|# endif
   61|      2|        ERR_load_X509_strings() == 0 ||
  ------------------
  |  Branch (61:9): [True: 0, False: 2]
  ------------------
   62|      2|        ERR_load_ASN1_strings() == 0 ||
  ------------------
  |  Branch (62:9): [True: 0, False: 2]
  ------------------
   63|      2|        ERR_load_CONF_strings() == 0 ||
  ------------------
  |  Branch (63:9): [True: 0, False: 2]
  ------------------
   64|      2|        ERR_load_CRYPTO_strings() == 0 ||
  ------------------
  |  Branch (64:9): [True: 0, False: 2]
  ------------------
   65|      2|# ifndef OPENSSL_NO_COMP
   66|      2|        ERR_load_COMP_strings() == 0 ||
  ------------------
  |  Branch (66:9): [True: 0, False: 2]
  ------------------
   67|      2|# endif
   68|      2|# ifndef OPENSSL_NO_EC
   69|      2|        ERR_load_EC_strings() == 0 ||
  ------------------
  |  Branch (69:9): [True: 0, False: 2]
  ------------------
   70|      2|# endif
   71|       |        /* skip ERR_load_SSL_strings() because it is not in this library */
   72|      2|        ERR_load_BIO_strings() == 0 ||
  ------------------
  |  Branch (72:9): [True: 0, False: 2]
  ------------------
   73|      2|        ERR_load_PKCS7_strings() == 0 ||
  ------------------
  |  Branch (73:9): [True: 0, False: 2]
  ------------------
   74|      2|        ERR_load_X509V3_strings() == 0 ||
  ------------------
  |  Branch (74:9): [True: 0, False: 2]
  ------------------
   75|      2|        ERR_load_PKCS12_strings() == 0 ||
  ------------------
  |  Branch (75:9): [True: 0, False: 2]
  ------------------
   76|      2|        ERR_load_RAND_strings() == 0 ||
  ------------------
  |  Branch (76:9): [True: 0, False: 2]
  ------------------
   77|      2|        ERR_load_DSO_strings() == 0 ||
  ------------------
  |  Branch (77:9): [True: 0, False: 2]
  ------------------
   78|      2|# ifndef OPENSSL_NO_TS
   79|      2|        ERR_load_TS_strings() == 0 ||
  ------------------
  |  Branch (79:9): [True: 0, False: 2]
  ------------------
   80|      2|# endif
   81|      2|# ifndef OPENSSL_NO_ENGINE
   82|      2|        ERR_load_ENGINE_strings() == 0 ||
  ------------------
  |  Branch (82:9): [True: 0, False: 2]
  ------------------
   83|      2|# endif
   84|      2|# ifndef OPENSSL_NO_OCSP
   85|      2|        ERR_load_OCSP_strings() == 0 ||
  ------------------
  |  Branch (85:9): [True: 0, False: 2]
  ------------------
   86|      2|# endif
   87|      2|        ERR_load_UI_strings() == 0 ||
  ------------------
  |  Branch (87:9): [True: 0, False: 2]
  ------------------
   88|      2|# ifndef OPENSSL_NO_CMS
   89|      2|        ERR_load_CMS_strings() == 0 ||
  ------------------
  |  Branch (89:9): [True: 0, False: 2]
  ------------------
   90|      2|# endif
   91|      2|# ifndef OPENSSL_NO_CT
   92|      2|        ERR_load_CT_strings() == 0 ||
  ------------------
  |  Branch (92:9): [True: 0, False: 2]
  ------------------
   93|      2|# endif
   94|      2|        ERR_load_ASYNC_strings() == 0 ||
  ------------------
  |  Branch (94:9): [True: 0, False: 2]
  ------------------
   95|      2|#endif
   96|      2|        ERR_load_KDF_strings() == 0 ||
  ------------------
  |  Branch (96:9): [True: 0, False: 2]
  ------------------
   97|      2|        ERR_load_OSSL_STORE_strings() == 0)
  ------------------
  |  Branch (97:9): [True: 0, False: 2]
  ------------------
   98|      0|        return 0;
   99|       |
  100|      2|    return 1;
  101|      2|}

ERR_load_EVP_strings:
  287|      2|{
  288|      2|#ifndef OPENSSL_NO_ERR
  289|      2|    if (ERR_func_error_string(EVP_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (289:9): [True: 2, False: 0]
  ------------------
  290|      2|        ERR_load_strings_const(EVP_str_functs);
  291|      2|        ERR_load_strings_const(EVP_str_reasons);
  292|      2|    }
  293|      2|#endif
  294|      2|    return 1;
  295|      2|}

EVP_PBE_cleanup:
  244|      2|{
  245|      2|    sk_EVP_PBE_CTL_pop_free(pbe_algs, free_evp_pbe_ctl);
  246|      2|    pbe_algs = NULL;
  247|      2|}

evp_cleanup_int:
   81|      2|{
   82|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   20|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   83|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   19|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   84|       |    /*
   85|       |     * The above calls will only clean out the contents of the name hash
   86|       |     * table, but not the hash table itself.  The following line does that
   87|       |     * part.  -- Richard Levitte
   88|       |     */
   89|      2|    OBJ_NAME_cleanup(-1);
   90|       |
   91|      2|    EVP_PBE_cleanup();
   92|      2|    OBJ_sigid_free();
   93|       |
   94|      2|    evp_app_cleanup_int();
   95|      2|}

evp_app_cleanup_int:
  317|      2|{
  318|      2|    if (app_pkey_methods != NULL)
  ------------------
  |  Branch (318:9): [True: 0, False: 2]
  ------------------
  319|      0|        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
  320|      2|}

crypto_cleanup_all_ex_data_int:
   94|      2|{
   95|      2|    int i;
   96|       |
   97|     34|    for (i = 0; i < CRYPTO_EX_INDEX__COUNT; ++i) {
  ------------------
  |  |  110|     34|# define CRYPTO_EX_INDEX__COUNT          16
  ------------------
  |  Branch (97:17): [True: 32, False: 2]
  ------------------
   98|     32|        EX_CALLBACKS *ip = &ex_data[i];
   99|       |
  100|     32|        sk_EX_CALLBACK_pop_free(ip->meth, cleanup_cb);
  101|     32|        ip->meth = NULL;
  102|     32|    }
  103|       |
  104|      2|    CRYPTO_THREAD_lock_free(ex_data_lock);
  105|      2|    ex_data_lock = NULL;
  106|      2|}
CRYPTO_new_ex_data:
  209|  15.4k|{
  210|  15.4k|    int mx, i;
  211|  15.4k|    void *ptr;
  212|  15.4k|    EX_CALLBACK **storage = NULL;
  213|  15.4k|    EX_CALLBACK *stack[10];
  214|  15.4k|    EX_CALLBACKS *ip = get_and_lock(class_index);
  215|       |
  216|  15.4k|    if (ip == NULL)
  ------------------
  |  Branch (216:9): [True: 0, False: 15.4k]
  ------------------
  217|      0|        return 0;
  218|       |
  219|  15.4k|    ad->sk = NULL;
  220|       |
  221|  15.4k|    mx = sk_EX_CALLBACK_num(ip->meth);
  222|  15.4k|    if (mx > 0) {
  ------------------
  |  Branch (222:9): [True: 0, False: 15.4k]
  ------------------
  223|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   13|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (223:13): [True: 0, False: 0]
  ------------------
  224|      0|            storage = stack;
  225|      0|        else
  226|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |  118|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  227|      0|        if (storage != NULL)
  ------------------
  |  Branch (227:13): [True: 0, False: 0]
  ------------------
  228|      0|            for (i = 0; i < mx; i++)
  ------------------
  |  Branch (228:25): [True: 0, False: 0]
  ------------------
  229|      0|                storage[i] = sk_EX_CALLBACK_value(ip->meth, i);
  230|      0|    }
  231|  15.4k|    CRYPTO_THREAD_unlock(ex_data_lock);
  232|       |
  233|  15.4k|    if (mx > 0 && storage == NULL) {
  ------------------
  |  Branch (233:9): [True: 0, False: 15.4k]
  |  Branch (233:19): [True: 0, False: 0]
  ------------------
  234|      0|        CRYPTOerr(CRYPTO_F_CRYPTO_NEW_EX_DATA, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  113|      0|# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  235|      0|        return 0;
  236|      0|    }
  237|  15.4k|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (237:17): [True: 0, False: 15.4k]
  ------------------
  238|      0|        if (storage[i] != NULL && storage[i]->new_func != NULL) {
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  |  Branch (238:35): [True: 0, False: 0]
  ------------------
  239|      0|            ptr = CRYPTO_get_ex_data(ad, i);
  240|      0|            storage[i]->new_func(obj, ptr, ad, i,
  241|      0|                                 storage[i]->argl, storage[i]->argp);
  242|      0|        }
  243|      0|    }
  244|  15.4k|    if (storage != stack)
  ------------------
  |  Branch (244:9): [True: 15.4k, False: 0]
  ------------------
  245|  15.4k|        OPENSSL_free(storage);
  ------------------
  |  |  128|  15.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  15.4k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  15.4k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  246|  15.4k|    return 1;
  247|  15.4k|}
CRYPTO_free_ex_data:
  321|  15.4k|{
  322|  15.4k|    int mx, i;
  323|  15.4k|    EX_CALLBACKS *ip;
  324|  15.4k|    void *ptr;
  325|  15.4k|    EX_CALLBACK *f;
  326|  15.4k|    EX_CALLBACK *stack[10];
  327|  15.4k|    EX_CALLBACK **storage = NULL;
  328|       |
  329|  15.4k|    if ((ip = get_and_lock(class_index)) == NULL)
  ------------------
  |  Branch (329:9): [True: 0, False: 15.4k]
  ------------------
  330|      0|        goto err;
  331|       |
  332|  15.4k|    mx = sk_EX_CALLBACK_num(ip->meth);
  333|  15.4k|    if (mx > 0) {
  ------------------
  |  Branch (333:9): [True: 0, False: 15.4k]
  ------------------
  334|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   13|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (334:13): [True: 0, False: 0]
  ------------------
  335|      0|            storage = stack;
  336|      0|        else
  337|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |  118|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  338|      0|        if (storage != NULL)
  ------------------
  |  Branch (338:13): [True: 0, False: 0]
  ------------------
  339|      0|            for (i = 0; i < mx; i++)
  ------------------
  |  Branch (339:25): [True: 0, False: 0]
  ------------------
  340|      0|                storage[i] = sk_EX_CALLBACK_value(ip->meth, i);
  341|      0|    }
  342|  15.4k|    CRYPTO_THREAD_unlock(ex_data_lock);
  343|       |
  344|  15.4k|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (344:17): [True: 0, False: 15.4k]
  ------------------
  345|      0|        if (storage != NULL)
  ------------------
  |  Branch (345:13): [True: 0, False: 0]
  ------------------
  346|      0|            f = storage[i];
  347|      0|        else {
  348|      0|            CRYPTO_THREAD_write_lock(ex_data_lock);
  349|      0|            f = sk_EX_CALLBACK_value(ip->meth, i);
  350|      0|            CRYPTO_THREAD_unlock(ex_data_lock);
  351|      0|        }
  352|      0|        if (f != NULL && f->free_func != NULL) {
  ------------------
  |  Branch (352:13): [True: 0, False: 0]
  |  Branch (352:26): [True: 0, False: 0]
  ------------------
  353|      0|            ptr = CRYPTO_get_ex_data(ad, i);
  354|      0|            f->free_func(obj, ptr, ad, i, f->argl, f->argp);
  355|      0|        }
  356|      0|    }
  357|       |
  358|  15.4k|    if (storage != stack)
  ------------------
  |  Branch (358:9): [True: 15.4k, False: 0]
  ------------------
  359|  15.4k|        OPENSSL_free(storage);
  ------------------
  |  |  128|  15.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  15.4k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  15.4k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  360|  15.4k| err:
  361|  15.4k|    sk_void_free(ad->sk);
  362|  15.4k|    ad->sk = NULL;
  363|  15.4k|}
ex_data.c:get_and_lock:
   51|  30.8k|{
   52|  30.8k|    EX_CALLBACKS *ip;
   53|       |
   54|  30.8k|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  110|  30.8k|# define CRYPTO_EX_INDEX__COUNT          16
  ------------------
  |  Branch (54:9): [True: 0, False: 30.8k]
  |  Branch (54:28): [True: 0, False: 30.8k]
  ------------------
   55|      0|        CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  113|      0|# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
   56|      0|        return NULL;
   57|      0|    }
   58|       |
   59|  30.8k|    if (!RUN_ONCE(&ex_data_init, do_ex_data_init)) {
  ------------------
  |  |  119|  30.8k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 30.8k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (59:9): [True: 0, False: 30.8k]
  ------------------
   60|      0|        CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  113|      0|# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
   61|      0|        return NULL;
   62|      0|    }
   63|       |
   64|  30.8k|    if (ex_data_lock == NULL) {
  ------------------
  |  Branch (64:9): [True: 0, False: 30.8k]
  ------------------
   65|       |        /*
   66|       |         * This can happen in normal operation when using CRYPTO_mem_leaks().
   67|       |         * The CRYPTO_mem_leaks() function calls OPENSSL_cleanup() which cleans
   68|       |         * up the locks. Subsequently the BIO that CRYPTO_mem_leaks() uses gets
   69|       |         * freed, which also attempts to free the ex_data. However
   70|       |         * CRYPTO_mem_leaks() ensures that the ex_data is freed early (i.e.
   71|       |         * before OPENSSL_cleanup() is called), so if we get here we can safely
   72|       |         * ignore this operation. We just treat it as an error.
   73|       |         */
   74|      0|         return NULL;
   75|      0|    }
   76|       |
   77|  30.8k|    ip = &ex_data[class_index];
   78|  30.8k|    CRYPTO_THREAD_write_lock(ex_data_lock);
   79|  30.8k|    return ip;
   80|  30.8k|}
ex_data.c:do_ex_data_init:
   39|      1|{
   40|      1|    if (!OPENSSL_init_crypto(0, NULL))
  ------------------
  |  Branch (40:9): [True: 0, False: 1]
  ------------------
   41|      0|        return 0;
   42|      1|    ex_data_lock = CRYPTO_THREAD_lock_new();
   43|      1|    return ex_data_lock != NULL;
   44|      1|}

ossl_safe_getenv:
   18|    504|{
   19|    504|#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
   20|    504|# if __GLIBC_PREREQ(2, 17)
   21|    504|#  define SECURE_GETENV
   22|    504|    return secure_getenv(name);
   23|    504|# endif
   24|    504|#endif
   25|       |
   26|       |#ifndef SECURE_GETENV
   27|       |    if (OPENSSL_issetugid())
   28|       |        return NULL;
   29|       |    return getenv(name);
   30|       |#endif
   31|    504|}

ossl_init_thread_start:
  458|      2|{
  459|      2|    struct thread_local_inits_st *locals;
  460|       |
  461|      2|    if (!OPENSSL_init_crypto(0, NULL))
  ------------------
  |  Branch (461:9): [True: 0, False: 2]
  ------------------
  462|      0|        return 0;
  463|       |
  464|      2|    locals = ossl_init_get_thread_local(1);
  465|       |
  466|      2|    if (locals == NULL)
  ------------------
  |  Branch (466:9): [True: 0, False: 2]
  ------------------
  467|      0|        return 0;
  468|       |
  469|      2|    if (opts & OPENSSL_INIT_THREAD_ASYNC) {
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_THREAD_ASYNC           0x01
  ------------------
  |  Branch (469:9): [True: 0, False: 2]
  ------------------
  470|       |#ifdef OPENSSL_INIT_DEBUG
  471|       |        fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "
  472|       |                        "marking thread for async\n");
  473|       |#endif
  474|      0|        locals->async = 1;
  475|      0|    }
  476|       |
  477|      2|    if (opts & OPENSSL_INIT_THREAD_ERR_STATE) {
  ------------------
  |  |   32|      2|# define OPENSSL_INIT_THREAD_ERR_STATE       0x02
  ------------------
  |  Branch (477:9): [True: 2, False: 0]
  ------------------
  478|       |#ifdef OPENSSL_INIT_DEBUG
  479|       |        fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "
  480|       |                        "marking thread for err_state\n");
  481|       |#endif
  482|      2|        locals->err_state = 1;
  483|      2|    }
  484|       |
  485|      2|    if (opts & OPENSSL_INIT_THREAD_RAND) {
  ------------------
  |  |   33|      2|# define OPENSSL_INIT_THREAD_RAND            0x04
  ------------------
  |  Branch (485:9): [True: 0, False: 2]
  ------------------
  486|       |#ifdef OPENSSL_INIT_DEBUG
  487|       |        fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "
  488|       |                        "marking thread for rand\n");
  489|       |#endif
  490|      0|        locals->rand = 1;
  491|      0|    }
  492|       |
  493|      2|    return 1;
  494|      2|}
OPENSSL_cleanup:
  497|      2|{
  498|      2|    OPENSSL_INIT_STOP *currhandler, *lasthandler;
  499|      2|    CRYPTO_THREAD_LOCAL key;
  500|       |
  501|       |    /* If we've not been inited then no need to deinit */
  502|      2|    if (!base_inited)
  ------------------
  |  Branch (502:9): [True: 0, False: 2]
  ------------------
  503|      0|        return;
  504|       |
  505|       |    /* Might be explicitly called and also by atexit */
  506|      2|    if (stopped)
  ------------------
  |  Branch (506:9): [True: 0, False: 2]
  ------------------
  507|      0|        return;
  508|      2|    stopped = 1;
  509|       |
  510|       |    /*
  511|       |     * Thread stop may not get automatically called by the thread library for
  512|       |     * the very last thread in some situations, so call it directly.
  513|       |     */
  514|      2|    ossl_init_thread_stop(ossl_init_get_thread_local(0));
  515|       |
  516|      2|    currhandler = stop_handlers;
  517|      2|    while (currhandler != NULL) {
  ------------------
  |  Branch (517:12): [True: 0, False: 2]
  ------------------
  518|      0|        currhandler->handler();
  519|      0|        lasthandler = currhandler;
  520|      0|        currhandler = currhandler->next;
  521|      0|        OPENSSL_free(lasthandler);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  522|      0|    }
  523|      2|    stop_handlers = NULL;
  524|       |
  525|      2|    CRYPTO_THREAD_lock_free(init_lock);
  526|      2|    init_lock = NULL;
  527|       |
  528|       |    /*
  529|       |     * We assume we are single-threaded for this function, i.e. no race
  530|       |     * conditions for the various "*_inited" vars below.
  531|       |     */
  532|       |
  533|      2|#ifndef OPENSSL_NO_COMP
  534|      2|    if (zlib_inited) {
  ------------------
  |  Branch (534:9): [True: 0, False: 2]
  ------------------
  535|       |#ifdef OPENSSL_INIT_DEBUG
  536|       |        fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
  537|       |                        "comp_zlib_cleanup_int()\n");
  538|       |#endif
  539|      0|        comp_zlib_cleanup_int();
  540|      0|    }
  541|      2|#endif
  542|       |
  543|      2|    if (async_inited) {
  ------------------
  |  Branch (543:9): [True: 0, False: 2]
  ------------------
  544|       |# ifdef OPENSSL_INIT_DEBUG
  545|       |        fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
  546|       |                        "async_deinit()\n");
  547|       |# endif
  548|      0|        async_deinit();
  549|      0|    }
  550|       |
  551|      2|    key = destructor_key.value;
  552|      2|    destructor_key.sane = -1;
  553|      2|    CRYPTO_THREAD_cleanup_local(&key);
  554|       |
  555|       |#ifdef OPENSSL_INIT_DEBUG
  556|       |    fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
  557|       |                    "rand_cleanup_int()\n");
  558|       |    fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
  559|       |                    "conf_modules_free_int()\n");
  560|       |#ifndef OPENSSL_NO_ENGINE
  561|       |    fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
  562|       |                    "engine_cleanup_int()\n");
  563|       |#endif
  564|       |    fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
  565|       |                    "crypto_cleanup_all_ex_data_int()\n");
  566|       |    fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
  567|       |                    "bio_sock_cleanup_int()\n");
  568|       |    fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
  569|       |                    "bio_cleanup()\n");
  570|       |    fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
  571|       |                    "evp_cleanup_int()\n");
  572|       |    fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
  573|       |                    "obj_cleanup_int()\n");
  574|       |    fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
  575|       |                    "err_cleanup()\n");
  576|       |#endif
  577|       |    /*
  578|       |     * Note that cleanup order is important:
  579|       |     * - rand_cleanup_int could call an ENGINE's RAND cleanup function so
  580|       |     * must be called before engine_cleanup_int()
  581|       |     * - ENGINEs use CRYPTO_EX_DATA and therefore, must be cleaned up
  582|       |     * before the ex data handlers are wiped in CRYPTO_cleanup_all_ex_data().
  583|       |     * - conf_modules_free_int() can end up in ENGINE code so must be called
  584|       |     * before engine_cleanup_int()
  585|       |     * - ENGINEs and additional EVP algorithms might use added OIDs names so
  586|       |     * obj_cleanup_int() must be called last
  587|       |     */
  588|      2|    rand_cleanup_int();
  589|      2|    rand_drbg_cleanup_int();
  590|      2|    conf_modules_free_int();
  591|      2|#ifndef OPENSSL_NO_ENGINE
  592|      2|    engine_cleanup_int();
  593|      2|#endif
  594|      2|    ossl_store_cleanup_int();
  595|      2|    crypto_cleanup_all_ex_data_int();
  596|      2|    bio_cleanup();
  597|      2|    evp_cleanup_int();
  598|      2|    obj_cleanup_int();
  599|      2|    err_cleanup();
  600|       |
  601|      2|    CRYPTO_secure_malloc_done();
  602|       |
  603|      2|    base_inited = 0;
  604|      2|}
OPENSSL_init_crypto:
  612|   259k|{
  613|   259k|    if (stopped) {
  ------------------
  |  Branch (613:9): [True: 0, False: 259k]
  ------------------
  614|      0|        if (!(opts & OPENSSL_INIT_BASE_ONLY))
  ------------------
  |  |   28|      0|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (614:13): [True: 0, False: 0]
  ------------------
  615|      0|            CRYPTOerr(CRYPTO_F_OPENSSL_INIT_CRYPTO, ERR_R_INIT_FAIL);
  ------------------
  |  |  113|      0|# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  616|      0|        return 0;
  617|      0|    }
  618|       |
  619|       |    /*
  620|       |     * When the caller specifies OPENSSL_INIT_BASE_ONLY, that should be the
  621|       |     * *only* option specified.  With that option we return immediately after
  622|       |     * doing the requested limited initialization.  Note that
  623|       |     * err_shelve_state() called by us via ossl_init_load_crypto_nodelete()
  624|       |     * re-enters OPENSSL_init_crypto() with OPENSSL_INIT_BASE_ONLY, but with
  625|       |     * base already initialized this is a harmless NOOP.
  626|       |     *
  627|       |     * If we remain the only caller of err_shelve_state() the recursion should
  628|       |     * perhaps be removed, but if in doubt, it can be left in place.
  629|       |     */
  630|   259k|    if (!RUN_ONCE(&base, ossl_init_base))
  ------------------
  |  |  119|   259k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 259k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (630:9): [True: 0, False: 259k]
  ------------------
  631|      0|        return 0;
  632|   259k|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   28|   259k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (632:9): [True: 259k, False: 9]
  ------------------
  633|   259k|        return 1;
  634|       |
  635|       |    /*
  636|       |     * Now we don't always set up exit handlers, the INIT_BASE_ONLY calls
  637|       |     * should not have the side-effect of setting up exit handlers, and
  638|       |     * therefore, this code block is below the INIT_BASE_ONLY-conditioned early
  639|       |     * return above.
  640|       |     */
  641|      9|    if ((opts & OPENSSL_INIT_NO_ATEXIT) != 0) {
  ------------------
  |  |  375|      9|# define OPENSSL_INIT_NO_ATEXIT              0x00080000L
  ------------------
  |  Branch (641:9): [True: 0, False: 9]
  ------------------
  642|      0|        if (!RUN_ONCE_ALT(&register_atexit, ossl_init_no_register_atexit,
  ------------------
  |  |  137|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (137:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (642:13): [True: 0, False: 0]
  ------------------
  643|      0|                          ossl_init_register_atexit))
  644|      0|            return 0;
  645|      9|    } else if (!RUN_ONCE(&register_atexit, ossl_init_register_atexit)) {
  ------------------
  |  |  119|      9|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 9, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (645:16): [True: 0, False: 9]
  ------------------
  646|      0|        return 0;
  647|      0|    }
  648|       |
  649|      9|    if (!RUN_ONCE(&load_crypto_nodelete, ossl_init_load_crypto_nodelete))
  ------------------
  |  |  119|      9|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 9, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (649:9): [True: 0, False: 9]
  ------------------
  650|      0|        return 0;
  651|       |
  652|      9|    if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  356|      9|# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
  ------------------
  |  Branch (652:9): [True: 0, False: 9]
  ------------------
  653|      9|            && !RUN_ONCE_ALT(&load_crypto_strings,
  ------------------
  |  |  137|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (137:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (653:16): [True: 0, False: 0]
  ------------------
  654|      9|                             ossl_init_no_load_crypto_strings,
  655|      9|                             ossl_init_load_crypto_strings))
  656|      0|        return 0;
  657|       |
  658|      9|    if ((opts & OPENSSL_INIT_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  357|      9|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  |  Branch (658:9): [True: 4, False: 5]
  ------------------
  659|      9|            && !RUN_ONCE(&load_crypto_strings, ossl_init_load_crypto_strings))
  ------------------
  |  |  119|      4|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 4, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (659:16): [True: 0, False: 4]
  ------------------
  660|      0|        return 0;
  661|       |
  662|      9|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_CIPHERS)
  ------------------
  |  |  360|      9|# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS     0x00000010L
  ------------------
  |  Branch (662:9): [True: 0, False: 9]
  ------------------
  663|      9|            && !RUN_ONCE_ALT(&add_all_ciphers, ossl_init_no_add_all_ciphers,
  ------------------
  |  |  137|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (137:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (663:16): [True: 0, False: 0]
  ------------------
  664|      9|                             ossl_init_add_all_ciphers))
  665|      0|        return 0;
  666|       |
  667|      9|    if ((opts & OPENSSL_INIT_ADD_ALL_CIPHERS)
  ------------------
  |  |  358|      9|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  |  Branch (667:9): [True: 0, False: 9]
  ------------------
  668|      9|            && !RUN_ONCE(&add_all_ciphers, ossl_init_add_all_ciphers))
  ------------------
  |  |  119|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (668:16): [True: 0, False: 0]
  ------------------
  669|      0|        return 0;
  670|       |
  671|      9|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_DIGESTS)
  ------------------
  |  |  361|      9|# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS     0x00000020L
  ------------------
  |  Branch (671:9): [True: 0, False: 9]
  ------------------
  672|      9|            && !RUN_ONCE_ALT(&add_all_digests, ossl_init_no_add_all_digests,
  ------------------
  |  |  137|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (137:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (672:16): [True: 0, False: 0]
  ------------------
  673|      9|                             ossl_init_add_all_digests))
  674|      0|        return 0;
  675|       |
  676|      9|    if ((opts & OPENSSL_INIT_ADD_ALL_DIGESTS)
  ------------------
  |  |  359|      9|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  |  Branch (676:9): [True: 0, False: 9]
  ------------------
  677|      9|            && !RUN_ONCE(&add_all_digests, ossl_init_add_all_digests))
  ------------------
  |  |  119|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (677:16): [True: 0, False: 0]
  ------------------
  678|      0|        return 0;
  679|       |
  680|      9|    if ((opts & OPENSSL_INIT_ATFORK)
  ------------------
  |  |  373|      9|# define OPENSSL_INIT_ATFORK                 0x00020000L
  ------------------
  |  Branch (680:9): [True: 0, False: 9]
  ------------------
  681|      9|            && !openssl_init_fork_handlers())
  ------------------
  |  Branch (681:16): [True: 0, False: 0]
  ------------------
  682|      0|        return 0;
  683|       |
  684|      9|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG)
  ------------------
  |  |  363|      9|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (684:9): [True: 0, False: 9]
  ------------------
  685|      9|            && !RUN_ONCE_ALT(&config, ossl_init_no_config, ossl_init_config))
  ------------------
  |  |  137|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (137:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (685:16): [True: 0, False: 0]
  ------------------
  686|      0|        return 0;
  687|       |
  688|      9|    if (opts & OPENSSL_INIT_LOAD_CONFIG) {
  ------------------
  |  |  362|      9|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (688:9): [True: 0, False: 9]
  ------------------
  689|      0|        int ret;
  690|      0|        CRYPTO_THREAD_write_lock(init_lock);
  691|      0|        conf_settings = settings;
  692|      0|        ret = RUN_ONCE(&config, ossl_init_config);
  ------------------
  |  |  119|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  693|      0|        conf_settings = NULL;
  694|      0|        CRYPTO_THREAD_unlock(init_lock);
  695|      0|        if (ret <= 0)
  ------------------
  |  Branch (695:13): [True: 0, False: 0]
  ------------------
  696|      0|            return 0;
  697|      0|    }
  698|       |
  699|      9|    if ((opts & OPENSSL_INIT_ASYNC)
  ------------------
  |  |  364|      9|# define OPENSSL_INIT_ASYNC                  0x00000100L
  ------------------
  |  Branch (699:9): [True: 0, False: 9]
  ------------------
  700|      9|            && !RUN_ONCE(&async, ossl_init_async))
  ------------------
  |  |  119|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (700:16): [True: 0, False: 0]
  ------------------
  701|      0|        return 0;
  702|       |
  703|      9|#ifndef OPENSSL_NO_ENGINE
  704|      9|    if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
  ------------------
  |  |  367|      9|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  |  Branch (704:9): [True: 0, False: 9]
  ------------------
  705|      9|            && !RUN_ONCE(&engine_openssl, ossl_init_engine_openssl))
  ------------------
  |  |  119|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (705:16): [True: 0, False: 0]
  ------------------
  706|      0|        return 0;
  707|       |# if !defined(OPENSSL_NO_HW) && !defined(OPENSSL_NO_DEVCRYPTOENG)
  708|       |    if ((opts & OPENSSL_INIT_ENGINE_CRYPTODEV)
  709|       |            && !RUN_ONCE(&engine_devcrypto, ossl_init_engine_devcrypto))
  710|       |        return 0;
  711|       |# endif
  712|      9|# ifndef OPENSSL_NO_RDRAND
  713|      9|    if ((opts & OPENSSL_INIT_ENGINE_RDRAND)
  ------------------
  |  |  365|      9|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  ------------------
  |  Branch (713:9): [True: 0, False: 9]
  ------------------
  714|      9|            && !RUN_ONCE(&engine_rdrand, ossl_init_engine_rdrand))
  ------------------
  |  |  119|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (714:16): [True: 0, False: 0]
  ------------------
  715|      0|        return 0;
  716|      9|# endif
  717|      9|    if ((opts & OPENSSL_INIT_ENGINE_DYNAMIC)
  ------------------
  |  |  366|      9|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  ------------------
  |  Branch (717:9): [True: 0, False: 9]
  ------------------
  718|      9|            && !RUN_ONCE(&engine_dynamic, ossl_init_engine_dynamic))
  ------------------
  |  |  119|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (718:16): [True: 0, False: 0]
  ------------------
  719|      0|        return 0;
  720|      9|# ifndef OPENSSL_NO_STATIC_ENGINE
  721|      9|#  if !defined(OPENSSL_NO_HW) && !defined(OPENSSL_NO_HW_PADLOCK)
  722|      9|    if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
  ------------------
  |  |  370|      9|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  ------------------
  |  Branch (722:9): [True: 0, False: 9]
  ------------------
  723|      9|            && !RUN_ONCE(&engine_padlock, ossl_init_engine_padlock))
  ------------------
  |  |  119|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (723:16): [True: 0, False: 0]
  ------------------
  724|      0|        return 0;
  725|      9|#  endif
  726|       |#  if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
  727|       |    if ((opts & OPENSSL_INIT_ENGINE_CAPI)
  728|       |            && !RUN_ONCE(&engine_capi, ossl_init_engine_capi))
  729|       |        return 0;
  730|       |#  endif
  731|      9|#  if !defined(OPENSSL_NO_AFALGENG)
  732|      9|    if ((opts & OPENSSL_INIT_ENGINE_AFALG)
  ------------------
  |  |  371|      9|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  |  Branch (732:9): [True: 0, False: 9]
  ------------------
  733|      9|            && !RUN_ONCE(&engine_afalg, ossl_init_engine_afalg))
  ------------------
  |  |  119|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (733:16): [True: 0, False: 0]
  ------------------
  734|      0|        return 0;
  735|      9|#  endif
  736|      9|# endif
  737|      9|    if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN
  ------------------
  |  |  381|      9|    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  365|      9|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  |  |  ------------------
  |  |                   (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  366|      9|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  |  |  ------------------
  |  |  382|      9|    | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  368|      9|# define OPENSSL_INIT_ENGINE_CRYPTODEV       0x00001000L
  |  |  ------------------
  |  |                   | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  369|      9|# define OPENSSL_INIT_ENGINE_CAPI            0x00002000L
  |  |  ------------------
  |  |  383|      9|    OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  370|      9|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  |  |  ------------------
  ------------------
  |  Branch (737:9): [True: 0, False: 9]
  ------------------
  738|      9|                | OPENSSL_INIT_ENGINE_OPENSSL
  ------------------
  |  |  367|      9|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  739|      9|                | OPENSSL_INIT_ENGINE_AFALG)) {
  ------------------
  |  |  371|      9|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  740|      0|        ENGINE_register_all_complete();
  741|      0|    }
  742|      9|#endif
  743|       |
  744|      9|#ifndef OPENSSL_NO_COMP
  745|      9|    if ((opts & OPENSSL_INIT_ZLIB)
  ------------------
  |  |   27|      9|# define OPENSSL_INIT_ZLIB                   0x00010000L
  ------------------
  |  Branch (745:9): [True: 0, False: 9]
  ------------------
  746|      9|            && !RUN_ONCE(&zlib, ossl_init_zlib))
  ------------------
  |  |  119|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (746:16): [True: 0, False: 0]
  ------------------
  747|      0|        return 0;
  748|      9|#endif
  749|       |
  750|      9|    return 1;
  751|      9|}
init.c:ossl_init_thread_stop:
  419|      2|{
  420|       |    /* Can't do much about this */
  421|      2|    if (locals == NULL)
  ------------------
  |  Branch (421:9): [True: 0, False: 2]
  ------------------
  422|      0|        return;
  423|       |
  424|      2|    if (locals->async) {
  ------------------
  |  Branch (424:9): [True: 0, False: 2]
  ------------------
  425|       |#ifdef OPENSSL_INIT_DEBUG
  426|       |        fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_stop: "
  427|       |                        "async_delete_thread_state()\n");
  428|       |#endif
  429|      0|        async_delete_thread_state();
  430|      0|    }
  431|       |
  432|      2|    if (locals->err_state) {
  ------------------
  |  Branch (432:9): [True: 2, False: 0]
  ------------------
  433|       |#ifdef OPENSSL_INIT_DEBUG
  434|       |        fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_stop: "
  435|       |                        "err_delete_thread_state()\n");
  436|       |#endif
  437|      2|        err_delete_thread_state();
  438|      2|    }
  439|       |
  440|      2|    if (locals->rand) {
  ------------------
  |  Branch (440:9): [True: 0, False: 2]
  ------------------
  441|       |#ifdef OPENSSL_INIT_DEBUG
  442|       |        fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_stop: "
  443|       |                        "drbg_delete_thread_state()\n");
  444|       |#endif
  445|      0|        drbg_delete_thread_state();
  446|      0|    }
  447|       |
  448|      2|    OPENSSL_free(locals);
  ------------------
  |  |  128|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      2|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      2|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  449|      2|}
init.c:ossl_init_get_thread_local:
   60|      4|{
   61|      4|    struct thread_local_inits_st *local =
   62|      4|        CRYPTO_THREAD_get_local(&destructor_key.value);
   63|       |
   64|      4|    if (alloc) {
  ------------------
  |  Branch (64:9): [True: 2, False: 2]
  ------------------
   65|      2|        if (local == NULL
  ------------------
  |  Branch (65:13): [True: 2, False: 0]
  ------------------
   66|      2|            && (local = OPENSSL_zalloc(sizeof(*local))) != NULL
  ------------------
  |  |  120|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      2|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      2|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (66:16): [True: 2, False: 0]
  ------------------
   67|      2|            && !CRYPTO_THREAD_set_local(&destructor_key.value, local)) {
  ------------------
  |  Branch (67:16): [True: 0, False: 2]
  ------------------
   68|      0|            OPENSSL_free(local);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   69|      0|            return NULL;
   70|      0|        }
   71|      2|    } else {
   72|      2|        CRYPTO_THREAD_set_local(&destructor_key.value, NULL);
   73|      2|    }
   74|       |
   75|      4|    return local;
   76|      4|}
init.c:ossl_init_base:
   90|      2|{
   91|      2|    CRYPTO_THREAD_LOCAL key;
   92|       |
   93|       |#ifdef OPENSSL_INIT_DEBUG
   94|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_base: Setting up stop handlers\n");
   95|       |#endif
   96|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
   97|       |    ossl_malloc_setup_failures();
   98|       |#endif
   99|      2|    if (!CRYPTO_THREAD_init_local(&key, ossl_init_thread_destructor))
  ------------------
  |  Branch (99:9): [True: 0, False: 2]
  ------------------
  100|      0|        return 0;
  101|      2|    if ((init_lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 2]
  ------------------
  102|      0|        goto err;
  103|      2|    OPENSSL_cpuid_setup();
  104|       |
  105|      2|    destructor_key.value = key;
  106|      2|    base_inited = 1;
  107|      2|    return 1;
  108|       |
  109|      0|err:
  110|       |#ifdef OPENSSL_INIT_DEBUG
  111|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_base not ok!\n");
  112|       |#endif
  113|      0|    CRYPTO_THREAD_lock_free(init_lock);
  114|      0|    init_lock = NULL;
  115|       |
  116|      0|    CRYPTO_THREAD_cleanup_local(&key);
  117|      0|    return 0;
  118|      2|}
init.c:ossl_init_register_atexit:
  130|      2|{
  131|       |#ifdef OPENSSL_INIT_DEBUG
  132|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_register_atexit()\n");
  133|       |#endif
  134|      2|#ifndef OPENSSL_SYS_UEFI
  135|       |# ifdef _WIN32
  136|       |    /* We use _onexit() in preference because it gets called on DLL unload */
  137|       |    if (_onexit(win32atexit) == NULL)
  138|       |        return 0;
  139|       |# else
  140|      2|    if (atexit(OPENSSL_cleanup) != 0)
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|        return 0;
  142|      2|# endif
  143|      2|#endif
  144|       |
  145|      2|    return 1;
  146|      2|}
init.c:ossl_init_load_crypto_nodelete:
  160|      2|{
  161|       |#ifdef OPENSSL_INIT_DEBUG
  162|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_load_crypto_nodelete()\n");
  163|       |#endif
  164|       |#if !defined(OPENSSL_USE_NODELETE) \
  165|       |    && !defined(OPENSSL_NO_PINSHARED)
  166|       |# if defined(DSO_WIN32) && !defined(_WIN32_WCE)
  167|       |    {
  168|       |        HMODULE handle = NULL;
  169|       |        BOOL ret;
  170|       |
  171|       |        /* We don't use the DSO route for WIN32 because there is a better way */
  172|       |        ret = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
  173|       |                                | GET_MODULE_HANDLE_EX_FLAG_PIN,
  174|       |                                (void *)&base_inited, &handle);
  175|       |
  176|       |#  ifdef OPENSSL_INIT_DEBUG
  177|       |        fprintf(stderr, "OPENSSL_INIT: obtained DSO reference? %s\n",
  178|       |                (ret == TRUE ? "No!" : "Yes."));
  179|       |#  endif
  180|       |        return (ret == TRUE) ? 1 : 0;
  181|       |    }
  182|       |# elif !defined(DSO_NONE)
  183|       |    /*
  184|       |     * Deliberately leak a reference to ourselves. This will force the library
  185|       |     * to remain loaded until the atexit() handler is run at process exit.
  186|       |     */
  187|       |    {
  188|       |        DSO *dso;
  189|       |        void *err;
  190|       |
  191|       |        if (!err_shelve_state(&err))
  192|       |            return 0;
  193|       |
  194|       |        dso = DSO_dsobyaddr(&base_inited, DSO_FLAG_NO_UNLOAD_ON_FREE);
  195|       |#  ifdef OPENSSL_INIT_DEBUG
  196|       |        fprintf(stderr, "OPENSSL_INIT: obtained DSO reference? %s\n",
  197|       |                (dso == NULL ? "No!" : "Yes."));
  198|       |        /*
  199|       |         * In case of No!, it is uncertain our exit()-handlers can still be
  200|       |         * called. After dlclose() the whole library might have been unloaded
  201|       |         * already.
  202|       |         */
  203|       |#  endif
  204|       |        DSO_free(dso);
  205|       |        err_unshelve_state(err);
  206|       |    }
  207|       |# endif
  208|       |#endif
  209|       |
  210|      2|    return 1;
  211|      2|}
init.c:ossl_init_load_crypto_strings:
  216|      2|{
  217|      2|    int ret = 1;
  218|       |    /*
  219|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
  220|       |     * pulling in all the error strings during static linking
  221|       |     */
  222|      2|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  223|       |# ifdef OPENSSL_INIT_DEBUG
  224|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_load_crypto_strings: "
  225|       |                    "err_load_crypto_strings_int()\n");
  226|       |# endif
  227|      2|    ret = err_load_crypto_strings_int();
  228|      2|#endif
  229|      2|    return ret;
  230|      2|}

ERR_load_KDF_strings:
   59|      2|{
   60|      2|#ifndef OPENSSL_NO_ERR
   61|      2|    if (ERR_func_error_string(KDF_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (61:9): [True: 2, False: 0]
  ------------------
   62|      2|        ERR_load_strings_const(KDF_str_functs);
   63|      2|        ERR_load_strings_const(KDF_str_reasons);
   64|      2|    }
   65|      2|#endif
   66|      2|    return 1;
   67|      2|}

OPENSSL_LH_new:
   48|  2.49k|{
   49|  2.49k|    OPENSSL_LHASH *ret;
   50|       |
   51|  2.49k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
  ------------------
  |  |  120|  2.49k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  2.49k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  2.49k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (51:9): [True: 0, False: 2.49k]
  ------------------
   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|       |         * CRYPTOerr(CRYPTO_F_OPENSSL_LH_NEW, ERR_R_MALLOC_FAILURE);
   56|       |         */
   57|      0|        return NULL;
   58|      0|    }
   59|  2.49k|    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
  ------------------
  |  |  120|  2.49k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  2.49k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  2.49k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (59:9): [True: 0, False: 2.49k]
  ------------------
   60|      0|        goto err;
   61|  2.49k|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (61:18): [True: 0, False: 2.49k]
  ------------------
   62|  2.49k|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (62:18): [True: 0, False: 2.49k]
  ------------------
   63|  2.49k|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|  2.49k|#define MIN_NODES       16
  ------------------
   64|  2.49k|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|  2.49k|#define MIN_NODES       16
  ------------------
   65|  2.49k|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|  2.49k|#define MIN_NODES       16
  ------------------
   66|  2.49k|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|  2.49k|#define UP_LOAD         (2*LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   70|  2.49k|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   67|  2.49k|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|  2.49k|#define DOWN_LOAD       (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   70|  2.49k|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   68|  2.49k|    return ret;
   69|       |
   70|      0|err:
   71|      0|    OPENSSL_free(ret->b);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|      0|    OPENSSL_free(ret);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|      0|    return NULL;
   74|  2.49k|}
OPENSSL_LH_free:
   77|  2.49k|{
   78|  2.49k|    unsigned int i;
   79|  2.49k|    OPENSSL_LH_NODE *n, *nn;
   80|       |
   81|  2.49k|    if (lh == NULL)
  ------------------
  |  Branch (81:9): [True: 2, False: 2.49k]
  ------------------
   82|      2|        return;
   83|       |
   84|  38.8k|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (84:17): [True: 36.3k, False: 2.49k]
  ------------------
   85|  36.3k|        n = lh->b[i];
   86|  55.1k|        while (n != NULL) {
  ------------------
  |  Branch (86:16): [True: 18.8k, False: 36.3k]
  ------------------
   87|  18.8k|            nn = n->next;
   88|  18.8k|            OPENSSL_free(n);
  ------------------
  |  |  128|  18.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  18.8k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  18.8k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   89|  18.8k|            n = nn;
   90|  18.8k|        }
   91|  36.3k|    }
   92|  2.49k|    OPENSSL_free(lh->b);
  ------------------
  |  |  128|  2.49k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  2.49k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  2.49k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|  2.49k|    OPENSSL_free(lh);
  ------------------
  |  |  128|  2.49k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  2.49k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  2.49k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  2.49k|}
OPENSSL_LH_insert:
   97|  57.6k|{
   98|  57.6k|    unsigned long hash;
   99|  57.6k|    OPENSSL_LH_NODE *nn, **rn;
  100|  57.6k|    void *ret;
  101|       |
  102|  57.6k|    lh->error = 0;
  103|  57.6k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   70|  57.6k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (103:9): [True: 16.3k, False: 41.2k]
  |  Branch (103:76): [True: 0, False: 16.3k]
  ------------------
  104|      0|        return NULL;        /* 'lh->error++' already done in 'expand' */
  105|       |
  106|  57.6k|    rn = getrn(lh, data, &hash);
  107|       |
  108|  57.6k|    if (*rn == NULL) {
  ------------------
  |  Branch (108:9): [True: 41.2k, False: 16.3k]
  ------------------
  109|  41.2k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |  118|  41.2k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  41.2k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  41.2k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (109:13): [True: 0, False: 41.2k]
  ------------------
  110|      0|            lh->error++;
  111|      0|            return NULL;
  112|      0|        }
  113|  41.2k|        nn->data = data;
  114|  41.2k|        nn->next = NULL;
  115|  41.2k|        nn->hash = hash;
  116|  41.2k|        *rn = nn;
  117|  41.2k|        ret = NULL;
  118|  41.2k|        lh->num_insert++;
  119|  41.2k|        lh->num_items++;
  120|  41.2k|    } else {                    /* replace same key */
  121|  16.3k|        ret = (*rn)->data;
  122|  16.3k|        (*rn)->data = data;
  123|  16.3k|        lh->num_replace++;
  124|  16.3k|    }
  125|  57.6k|    return ret;
  126|  57.6k|}
OPENSSL_LH_delete:
  129|  22.4k|{
  130|  22.4k|    unsigned long hash;
  131|  22.4k|    OPENSSL_LH_NODE *nn, **rn;
  132|  22.4k|    void *ret;
  133|       |
  134|  22.4k|    lh->error = 0;
  135|  22.4k|    rn = getrn(lh, data, &hash);
  136|       |
  137|  22.4k|    if (*rn == NULL) {
  ------------------
  |  Branch (137:9): [True: 0, False: 22.4k]
  ------------------
  138|      0|        lh->num_no_delete++;
  139|      0|        return NULL;
  140|  22.4k|    } else {
  141|  22.4k|        nn = *rn;
  142|  22.4k|        *rn = nn->next;
  143|  22.4k|        ret = nn->data;
  144|  22.4k|        OPENSSL_free(nn);
  ------------------
  |  |  128|  22.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  22.4k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  22.4k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  145|  22.4k|        lh->num_delete++;
  146|  22.4k|    }
  147|       |
  148|  22.4k|    lh->num_items--;
  149|  22.4k|    if ((lh->num_nodes > MIN_NODES) &&
  ------------------
  |  |   39|  22.4k|#define MIN_NODES       16
  ------------------
  |  Branch (149:9): [True: 19.4k, False: 2.97k]
  ------------------
  150|  22.4k|        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
  ------------------
  |  |   70|  19.4k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (150:9): [True: 0, False: 19.4k]
  ------------------
  151|      0|        contract(lh);
  152|       |
  153|  22.4k|    return ret;
  154|  22.4k|}
OPENSSL_LH_retrieve:
  157|  32.8k|{
  158|  32.8k|    unsigned long hash;
  159|  32.8k|    OPENSSL_LH_NODE **rn;
  160|  32.8k|    void *ret;
  161|       |
  162|  32.8k|    tsan_store((TSAN_QUALIFIER int *)&lh->error, 0);
  ------------------
  |  |   58|  32.8k|#  define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  163|       |
  164|  32.8k|    rn = getrn(lh, data, &hash);
  165|       |
  166|  32.8k|    if (*rn == NULL) {
  ------------------
  |  Branch (166:9): [True: 14.6k, False: 18.1k]
  ------------------
  167|  14.6k|        tsan_counter(&lh->num_retrieve_miss);
  ------------------
  |  |   59|  14.6k|#  define tsan_counter(ptr) atomic_fetch_add_explicit((ptr), 1, memory_order_relaxed)
  ------------------
  168|  14.6k|        return NULL;
  169|  18.1k|    } else {
  170|  18.1k|        ret = (*rn)->data;
  171|  18.1k|        tsan_counter(&lh->num_retrieve);
  ------------------
  |  |   59|  18.1k|#  define tsan_counter(ptr) atomic_fetch_add_explicit((ptr), 1, memory_order_relaxed)
  ------------------
  172|  18.1k|    }
  173|       |
  174|  18.1k|    return ret;
  175|  32.8k|}
OPENSSL_LH_doall:
  205|  2.49k|{
  206|  2.49k|    doall_util_fn(lh, 0, func, (OPENSSL_LH_DOALL_FUNCARG)0, NULL);
  207|  2.49k|}
OPENSSL_LH_doall_arg:
  210|  2.49k|{
  211|  2.49k|    doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg);
  212|  2.49k|}
OPENSSL_LH_strhash:
  332|   195k|{
  333|   195k|    unsigned long ret = 0;
  334|   195k|    long n;
  335|   195k|    unsigned long v;
  336|   195k|    int r;
  337|       |
  338|   195k|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (338:9): [True: 26.5k, False: 168k]
  |  Branch (338:24): [True: 51.3k, False: 117k]
  ------------------
  339|  77.9k|        return ret;
  340|       |
  341|   117k|    n = 0x100;
  342|  78.7M|    while (*c) {
  ------------------
  |  Branch (342:12): [True: 78.6M, False: 117k]
  ------------------
  343|  78.6M|        v = n | (*c);
  344|  78.6M|        n += 0x100;
  345|  78.6M|        r = (int)((v >> 2) ^ v) & 0x0f;
  346|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  347|  78.6M|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  348|  78.6M|        ret &= 0xFFFFFFFFL;
  349|  78.6M|        ret ^= v * v;
  350|  78.6M|        c++;
  351|  78.6M|    }
  352|   117k|    return (ret >> 16) ^ ret;
  353|   195k|}
OPENSSL_LH_num_items:
  378|      2|{
  379|      2|    return lh ? lh->num_items : 0;
  ------------------
  |  Branch (379:12): [True: 0, False: 2]
  ------------------
  380|      2|}
OPENSSL_LH_set_down_load:
  388|  2.49k|{
  389|  2.49k|    lh->down_load = down_load;
  390|  2.49k|}
OPENSSL_LH_error:
  393|  13.9k|{
  394|  13.9k|    return lh->error;
  395|  13.9k|}
lhash.c:doall_util_fn:
  180|  4.98k|{
  181|  4.98k|    int i;
  182|  4.98k|    OPENSSL_LH_NODE *a, *n;
  183|       |
  184|  4.98k|    if (lh == NULL)
  ------------------
  |  Branch (184:9): [True: 0, False: 4.98k]
  ------------------
  185|      0|        return;
  186|       |
  187|       |    /*
  188|       |     * reverse the order so we search from 'top to bottom' We were having
  189|       |     * memory leaks otherwise
  190|       |     */
  191|  72.7k|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (191:33): [True: 67.7k, False: 4.98k]
  ------------------
  192|  67.7k|        a = lh->b[i];
  193|   118k|        while (a != NULL) {
  ------------------
  |  Branch (193:16): [True: 50.3k, False: 67.7k]
  ------------------
  194|  50.3k|            n = a->next;
  195|  50.3k|            if (use_arg)
  ------------------
  |  Branch (195:17): [True: 36.4k, False: 13.9k]
  ------------------
  196|  36.4k|                func_arg(a->data, arg);
  197|  13.9k|            else
  198|  13.9k|                func(a->data);
  199|  50.3k|            a = n;
  200|  50.3k|        }
  201|  67.7k|    }
  202|  4.98k|}
lhash.c:expand:
  215|  16.3k|{
  216|  16.3k|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  217|  16.3k|    unsigned int p, pmax, nni, j;
  218|  16.3k|    unsigned long hash;
  219|       |
  220|  16.3k|    nni = lh->num_alloc_nodes;
  221|  16.3k|    p = lh->p;
  222|  16.3k|    pmax = lh->pmax;
  223|  16.3k|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (223:9): [True: 398, False: 15.9k]
  ------------------
  224|    398|        j = nni * 2;
  225|    398|        n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
  ------------------
  |  |  122|    398|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|    398|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|    398|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  226|    398|        if (n == NULL) {
  ------------------
  |  Branch (226:13): [True: 0, False: 398]
  ------------------
  227|      0|            lh->error++;
  228|      0|            return 0;
  229|      0|        }
  230|    398|        lh->b = n;
  231|    398|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  232|    398|        lh->pmax = nni;
  233|    398|        lh->num_alloc_nodes = j;
  234|    398|        lh->num_expand_reallocs++;
  235|    398|        lh->p = 0;
  236|  15.9k|    } else {
  237|  15.9k|        lh->p++;
  238|  15.9k|    }
  239|       |
  240|  16.3k|    lh->num_nodes++;
  241|  16.3k|    lh->num_expands++;
  242|  16.3k|    n1 = &(lh->b[p]);
  243|  16.3k|    n2 = &(lh->b[p + pmax]);
  244|  16.3k|    *n2 = NULL;
  245|       |
  246|  65.5k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (246:20): [True: 49.1k, False: 16.3k]
  ------------------
  247|  49.1k|        hash = np->hash;
  248|  49.1k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (248:13): [True: 18.6k, False: 30.5k]
  ------------------
  249|  18.6k|            *n1 = (*n1)->next;
  250|  18.6k|            np->next = *n2;
  251|  18.6k|            *n2 = np;
  252|  18.6k|        } else
  253|  30.5k|            n1 = &((*n1)->next);
  254|  49.1k|        np = *n1;
  255|  49.1k|    }
  256|       |
  257|  16.3k|    return 1;
  258|  16.3k|}
lhash.c:getrn:
  297|   112k|{
  298|   112k|    OPENSSL_LH_NODE **ret, *n1;
  299|   112k|    unsigned long hash, nn;
  300|   112k|    OPENSSL_LH_COMPFUNC cf;
  301|       |
  302|   112k|    hash = (*(lh->hash)) (data);
  303|   112k|    tsan_counter(&lh->num_hash_calls);
  ------------------
  |  |   59|   112k|#  define tsan_counter(ptr) atomic_fetch_add_explicit((ptr), 1, memory_order_relaxed)
  ------------------
  304|   112k|    *rhash = hash;
  305|       |
  306|   112k|    nn = hash % lh->pmax;
  307|   112k|    if (nn < lh->p)
  ------------------
  |  Branch (307:9): [True: 38.1k, False: 74.7k]
  ------------------
  308|  38.1k|        nn = hash % lh->num_alloc_nodes;
  309|       |
  310|   112k|    cf = lh->comp;
  311|   112k|    ret = &(lh->b[(int)nn]);
  312|   523k|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (312:21): [True: 467k, False: 55.9k]
  ------------------
  313|   467k|        tsan_counter(&lh->num_hash_comps);
  ------------------
  |  |   59|   467k|#  define tsan_counter(ptr) atomic_fetch_add_explicit((ptr), 1, memory_order_relaxed)
  ------------------
  314|   467k|        if (n1->hash != hash) {
  ------------------
  |  Branch (314:13): [True: 367k, False: 100k]
  ------------------
  315|   367k|            ret = &(n1->next);
  316|   367k|            continue;
  317|   367k|        }
  318|   467k|        tsan_counter(&lh->num_comp_calls);
  ------------------
  |  |   59|   467k|#  define tsan_counter(ptr) atomic_fetch_add_explicit((ptr), 1, memory_order_relaxed)
  ------------------
  319|   100k|        if (cf(n1->data, data) == 0)
  ------------------
  |  Branch (319:13): [True: 56.9k, False: 43.2k]
  ------------------
  320|  56.9k|            break;
  321|  43.2k|        ret = &(n1->next);
  322|  43.2k|    }
  323|   112k|    return ret;
  324|   112k|}

CRYPTO_malloc:
  193|   481k|{
  194|   481k|    void *ret = NULL;
  195|       |
  196|   481k|    INCREMENT(malloc_count);
  197|   481k|    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
  ------------------
  |  Branch (197:9): [True: 481k, False: 0]
  |  Branch (197:32): [True: 0, False: 481k]
  ------------------
  198|      0|        return malloc_impl(num, file, line);
  199|       |
  200|   481k|    if (num == 0)
  ------------------
  |  Branch (200:9): [True: 0, False: 481k]
  ------------------
  201|      0|        return NULL;
  202|       |
  203|   481k|    FAILTEST();
  204|   481k|    if (allow_customize) {
  ------------------
  |  Branch (204:9): [True: 2, False: 481k]
  ------------------
  205|       |        /*
  206|       |         * Disallow customization after the first allocation. We only set this
  207|       |         * if necessary to avoid a store to the same cache line on every
  208|       |         * allocation.
  209|       |         */
  210|      2|        allow_customize = 0;
  211|      2|    }
  212|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
  213|       |    if (call_malloc_debug) {
  214|       |        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);
  215|       |        ret = malloc(num);
  216|       |        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);
  217|       |    } else {
  218|       |        ret = malloc(num);
  219|       |    }
  220|       |#else
  221|   481k|    (void)(file); (void)(line);
  222|   481k|    ret = malloc(num);
  223|   481k|#endif
  224|       |
  225|   481k|    return ret;
  226|   481k|}
CRYPTO_zalloc:
  229|   208k|{
  230|   208k|    void *ret = CRYPTO_malloc(num, file, line);
  231|       |
  232|   208k|    FAILTEST();
  233|   208k|    if (ret != NULL)
  ------------------
  |  Branch (233:9): [True: 208k, False: 0]
  ------------------
  234|   208k|        memset(ret, 0, num);
  235|   208k|    return ret;
  236|   208k|}
CRYPTO_realloc:
  239|   132k|{
  240|   132k|    INCREMENT(realloc_count);
  241|   132k|    if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
  ------------------
  |  Branch (241:9): [True: 132k, False: 0]
  |  Branch (241:33): [True: 0, False: 132k]
  ------------------
  242|      0|        return realloc_impl(str, num, file, line);
  243|       |
  244|   132k|    FAILTEST();
  245|   132k|    if (str == NULL)
  ------------------
  |  Branch (245:9): [True: 42.5k, False: 90.3k]
  ------------------
  246|  42.5k|        return CRYPTO_malloc(num, file, line);
  247|       |
  248|  90.3k|    if (num == 0) {
  ------------------
  |  Branch (248:9): [True: 0, False: 90.3k]
  ------------------
  249|      0|        CRYPTO_free(str, file, line);
  250|      0|        return NULL;
  251|      0|    }
  252|       |
  253|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
  254|       |    if (call_malloc_debug) {
  255|       |        void *ret;
  256|       |        CRYPTO_mem_debug_realloc(str, NULL, num, 0, file, line);
  257|       |        ret = realloc(str, num);
  258|       |        CRYPTO_mem_debug_realloc(str, ret, num, 1, file, line);
  259|       |        return ret;
  260|       |    }
  261|       |#else
  262|  90.3k|    (void)(file); (void)(line);
  263|  90.3k|#endif
  264|  90.3k|    return realloc(str, num);
  265|       |
  266|  90.3k|}
CRYPTO_clear_realloc:
  270|  13.0k|{
  271|  13.0k|    void *ret = NULL;
  272|       |
  273|  13.0k|    if (str == NULL)
  ------------------
  |  Branch (273:9): [True: 2.49k, False: 10.5k]
  ------------------
  274|  2.49k|        return CRYPTO_malloc(num, file, line);
  275|       |
  276|  10.5k|    if (num == 0) {
  ------------------
  |  Branch (276:9): [True: 0, False: 10.5k]
  ------------------
  277|      0|        CRYPTO_clear_free(str, old_len, file, line);
  278|      0|        return NULL;
  279|      0|    }
  280|       |
  281|       |    /* Can't shrink the buffer since memcpy below copies |old_len| bytes. */
  282|  10.5k|    if (num < old_len) {
  ------------------
  |  Branch (282:9): [True: 0, False: 10.5k]
  ------------------
  283|      0|        OPENSSL_cleanse((char*)str + num, old_len - num);
  284|      0|        return str;
  285|      0|    }
  286|       |
  287|  10.5k|    ret = CRYPTO_malloc(num, file, line);
  288|  10.5k|    if (ret != NULL) {
  ------------------
  |  Branch (288:9): [True: 10.5k, False: 0]
  ------------------
  289|  10.5k|        memcpy(ret, str, old_len);
  290|  10.5k|        CRYPTO_clear_free(str, old_len, file, line);
  291|  10.5k|    }
  292|  10.5k|    return ret;
  293|  10.5k|}
CRYPTO_free:
  296|   553k|{
  297|   553k|    INCREMENT(free_count);
  298|   553k|    if (free_impl != NULL && free_impl != &CRYPTO_free) {
  ------------------
  |  Branch (298:9): [True: 553k, False: 0]
  |  Branch (298:30): [True: 0, False: 553k]
  ------------------
  299|      0|        free_impl(str, file, line);
  300|      0|        return;
  301|      0|    }
  302|       |
  303|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
  304|       |    if (call_malloc_debug) {
  305|       |        CRYPTO_mem_debug_free(str, 0, file, line);
  306|       |        free(str);
  307|       |        CRYPTO_mem_debug_free(str, 1, file, line);
  308|       |    } else {
  309|       |        free(str);
  310|       |    }
  311|       |#else
  312|   553k|    free(str);
  313|   553k|#endif
  314|   553k|}
CRYPTO_clear_free:
  317|  15.7k|{
  318|  15.7k|    if (str == NULL)
  ------------------
  |  Branch (318:9): [True: 0, False: 15.7k]
  ------------------
  319|      0|        return;
  320|  15.7k|    if (num)
  ------------------
  |  Branch (320:9): [True: 15.7k, False: 0]
  ------------------
  321|  15.7k|        OPENSSL_cleanse(str, num);
  322|  15.7k|    CRYPTO_free(str, file, line);
  323|  15.7k|}

CRYPTO_secure_malloc_done:
   98|      2|{
   99|      2|#ifdef OPENSSL_SECURE_MEMORY
  100|      2|    if (secure_mem_used == 0) {
  ------------------
  |  Branch (100:9): [True: 2, False: 0]
  ------------------
  101|      2|        sh_done();
  102|      2|        secure_mem_initialized = 0;
  103|      2|        CRYPTO_THREAD_lock_free(sec_malloc_lock);
  104|      2|        sec_malloc_lock = NULL;
  105|      2|        return 1;
  106|      2|    }
  107|      0|#endif /* OPENSSL_SECURE_MEMORY */
  108|      0|    return 0;
  109|      2|}
mem_sec.c:sh_done:
  507|      2|{
  508|      2|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  128|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      2|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      2|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  509|      2|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  128|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      2|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      2|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  510|      2|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  128|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      2|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      2|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  511|      2|    if (sh.map_result != MAP_FAILED && sh.map_size)
  ------------------
  |  Branch (511:9): [True: 2, False: 0]
  |  Branch (511:40): [True: 0, False: 2]
  ------------------
  512|      0|        munmap(sh.map_result, sh.map_size);
  513|      2|    memset(&sh, 0, sizeof(sh));
  514|      2|}

openssl_fopen:
   39|  97.2k|{
   40|  97.2k|    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|       |                CRYPTOerr(CRYPTO_F_OPENSSL_FOPEN, 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|  97.2k|    file = fopen(filename, mode);
  115|  97.2k|# endif
  116|  97.2k|    return file;
  117|  97.2k|}

CRYPTO_strdup:
   28|  31.1k|{
   29|  31.1k|    char *ret;
   30|       |
   31|  31.1k|    if (str == NULL)
  ------------------
  |  Branch (31:9): [True: 0, False: 31.1k]
  ------------------
   32|      0|        return NULL;
   33|  31.1k|    ret = CRYPTO_malloc(strlen(str) + 1, file, line);
   34|  31.1k|    if (ret != NULL)
  ------------------
  |  Branch (34:9): [True: 31.1k, False: 0]
  ------------------
   35|  31.1k|        strcpy(ret, str);
   36|  31.1k|    return ret;
   37|  31.1k|}
OPENSSL_strlcpy:
   82|  1.34M|{
   83|  1.34M|    size_t l = 0;
   84|   765M|    for (; size > 1 && *src; size--) {
  ------------------
  |  Branch (84:12): [True: 765M, False: 97.2k]
  |  Branch (84:24): [True: 763M, False: 1.24M]
  ------------------
   85|   763M|        *dst++ = *src++;
   86|   763M|        l++;
   87|   763M|    }
   88|  1.34M|    if (size)
  ------------------
  |  Branch (88:9): [True: 1.34M, False: 0]
  ------------------
   89|  1.34M|        *dst = '\0';
   90|  1.34M|    return l + strlen(src);
   91|  1.34M|}
OPENSSL_strlcat:
   94|   619k|{
   95|   619k|    size_t l = 0;
   96|  1.83G|    for (; size > 0 && *dst; size--, dst++)
  ------------------
  |  Branch (96:12): [True: 1.83G, False: 0]
  |  Branch (96:24): [True: 1.83G, False: 619k]
  ------------------
   97|  1.83G|        l++;
   98|   619k|    return l + OPENSSL_strlcpy(dst, src, size);
   99|   619k|}
openssl_strerror_r:
  222|    254|{
  223|       |#if defined(_MSC_VER) && _MSC_VER>=1400 && !defined(_WIN32_WCE)
  224|       |    return !strerror_s(buf, buflen, errnum);
  225|       |#elif defined(_GNU_SOURCE)
  226|       |    char *err;
  227|       |
  228|       |    /*
  229|       |     * GNU strerror_r may not actually set buf.
  230|       |     * It can return a pointer to some (immutable) static string in which case
  231|       |     * buf is left unused.
  232|       |     */
  233|       |    err = strerror_r(errnum, buf, buflen);
  234|       |    if (err == NULL || buflen == 0)
  235|       |        return 0;
  236|       |    /*
  237|       |     * If err is statically allocated, err != buf and we need to copy the data.
  238|       |     * If err points somewhere inside buf, OPENSSL_strlcpy can handle this,
  239|       |     * since src and dest are not annotated with __restrict and the function
  240|       |     * reads src byte for byte and writes to dest.
  241|       |     * If err == buf we do not have to copy anything.
  242|       |     */
  243|       |    if (err != buf)
  244|       |        OPENSSL_strlcpy(buf, err, buflen);
  245|       |    return 1;
  246|       |#elif (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || \
  247|       |      (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600)
  248|       |    /*
  249|       |     * We can use "real" strerror_r. The OpenSSL version differs in that it
  250|       |     * gives 1 on success and 0 on failure for consistency with other OpenSSL
  251|       |     * functions. Real strerror_r does it the other way around
  252|       |     */
  253|    254|    return !strerror_r(errnum, buf, buflen);
  254|       |#else
  255|       |    char *err;
  256|       |
  257|       |    /* Fall back to non-thread safe strerror()...its all we can do */
  258|       |    if (buflen < 2)
  259|       |        return 0;
  260|       |    err = strerror(errnum);
  261|       |    /* Can this ever happen? */
  262|       |    if (err == NULL)
  263|       |        return 0;
  264|       |    OPENSSL_strlcpy(buf, err, buflen);
  265|       |    return 1;
  266|       |#endif
  267|    254|}

OBJ_NAME_cleanup:
  390|      6|{
  391|      6|    unsigned long down_load;
  392|       |
  393|      6|    if (names_lh == NULL)
  ------------------
  |  Branch (393:9): [True: 6, False: 0]
  ------------------
  394|      6|        return;
  395|       |
  396|      0|    free_type = type;
  397|      0|    down_load = lh_OBJ_NAME_get_down_load(names_lh);
  398|      0|    lh_OBJ_NAME_set_down_load(names_lh, 0);
  399|       |
  400|      0|    lh_OBJ_NAME_doall(names_lh, names_lh_free_doall);
  401|      0|    if (type < 0) {
  ------------------
  |  Branch (401:9): [True: 0, False: 0]
  ------------------
  402|      0|        lh_OBJ_NAME_free(names_lh);
  403|      0|        sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
  404|      0|        CRYPTO_THREAD_lock_free(obj_lock);
  405|      0|        names_lh = NULL;
  406|      0|        name_funcs_stack = NULL;
  407|      0|        obj_lock = NULL;
  408|      0|    } else
  409|      0|        lh_OBJ_NAME_set_down_load(names_lh, down_load);
  410|      0|}

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|}

ERR_load_OBJ_strings:
   38|      2|{
   39|      2|#ifndef OPENSSL_NO_ERR
   40|      2|    if (ERR_func_error_string(OBJ_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (40:9): [True: 2, False: 0]
  ------------------
   41|      2|        ERR_load_strings_const(OBJ_str_functs);
   42|      2|        ERR_load_strings_const(OBJ_str_reasons);
   43|      2|    }
   44|      2|#endif
   45|      2|    return 1;
   46|      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|}

ERR_load_OCSP_strings:
   93|      2|{
   94|      2|#ifndef OPENSSL_NO_ERR
   95|      2|    if (ERR_func_error_string(OCSP_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (95:9): [True: 2, False: 0]
  ------------------
   96|      2|        ERR_load_strings_const(OCSP_str_functs);
   97|      2|        ERR_load_strings_const(OCSP_str_reasons);
   98|      2|    }
   99|      2|#endif
  100|      2|    return 1;
  101|      2|}

ERR_load_PEM_strings:
  122|      2|{
  123|      2|#ifndef OPENSSL_NO_ERR
  124|      2|    if (ERR_func_error_string(PEM_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (124:9): [True: 2, False: 0]
  ------------------
  125|      2|        ERR_load_strings_const(PEM_str_functs);
  126|      2|        ERR_load_strings_const(PEM_str_reasons);
  127|      2|    }
  128|      2|#endif
  129|      2|    return 1;
  130|      2|}

ERR_load_PKCS12_strings:
  109|      2|{
  110|      2|#ifndef OPENSSL_NO_ERR
  111|      2|    if (ERR_func_error_string(PKCS12_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (111:9): [True: 2, False: 0]
  ------------------
  112|      2|        ERR_load_strings_const(PKCS12_str_functs);
  113|      2|        ERR_load_strings_const(PKCS12_str_reasons);
  114|      2|    }
  115|      2|#endif
  116|      2|    return 1;
  117|      2|}

ERR_load_PKCS7_strings:
  148|      2|{
  149|      2|#ifndef OPENSSL_NO_ERR
  150|      2|    if (ERR_func_error_string(PKCS7_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (150:9): [True: 2, False: 0]
  ------------------
  151|      2|        ERR_load_strings_const(PKCS7_str_functs);
  152|      2|        ERR_load_strings_const(PKCS7_str_reasons);
  153|      2|    }
  154|      2|#endif
  155|      2|    return 1;
  156|      2|}

rand_drbg_cleanup_int:
  925|      2|{
  926|      2|    if (master_drbg != NULL) {
  ------------------
  |  Branch (926:9): [True: 0, False: 2]
  ------------------
  927|      0|        RAND_DRBG_free(master_drbg);
  928|      0|        master_drbg = NULL;
  929|       |
  930|      0|        CRYPTO_THREAD_cleanup_local(&private_drbg);
  931|      0|        CRYPTO_THREAD_cleanup_local(&public_drbg);
  932|      0|    }
  933|      2|}

ERR_load_RAND_strings:
  131|      2|{
  132|      2|#ifndef OPENSSL_NO_ERR
  133|      2|    if (ERR_func_error_string(RAND_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (133:9): [True: 2, False: 0]
  ------------------
  134|      2|        ERR_load_strings_const(RAND_str_functs);
  135|      2|        ERR_load_strings_const(RAND_str_reasons);
  136|      2|    }
  137|      2|#endif
  138|      2|    return 1;
  139|      2|}

rand_cleanup_int:
  345|      2|{
  346|      2|    const RAND_METHOD *meth = default_RAND_meth;
  347|       |
  348|      2|    if (!rand_inited)
  ------------------
  |  Branch (348:9): [True: 2, False: 0]
  ------------------
  349|      2|        return;
  350|       |
  351|      0|    if (meth != NULL && meth->cleanup != NULL)
  ------------------
  |  Branch (351:9): [True: 0, False: 0]
  |  Branch (351:25): [True: 0, False: 0]
  ------------------
  352|      0|        meth->cleanup();
  353|      0|    RAND_set_rand_method(NULL);
  354|      0|    rand_pool_cleanup();
  355|      0|#ifndef OPENSSL_NO_ENGINE
  356|      0|    CRYPTO_THREAD_lock_free(rand_engine_lock);
  357|      0|    rand_engine_lock = NULL;
  358|      0|#endif
  359|      0|    CRYPTO_THREAD_lock_free(rand_meth_lock);
  360|      0|    rand_meth_lock = NULL;
  361|      0|    CRYPTO_THREAD_lock_free(rand_nonce_lock);
  362|      0|    rand_nonce_lock = NULL;
  363|      0|    rand_inited = 0;
  364|      0|}

ERR_load_RSA_strings:
  240|      2|{
  241|      2|#ifndef OPENSSL_NO_ERR
  242|      2|    if (ERR_func_error_string(RSA_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (242:9): [True: 2, False: 0]
  ------------------
  243|      2|        ERR_load_strings_const(RSA_str_functs);
  244|      2|        ERR_load_strings_const(RSA_str_reasons);
  245|      2|    }
  246|      2|#endif
  247|      2|    return 1;
  248|      2|}

OPENSSL_sk_new_null:
  117|  14.0k|{
  118|  14.0k|    return OPENSSL_sk_new_reserve(NULL, 0);
  119|  14.0k|}
OPENSSL_sk_new_reserve:
  208|  14.0k|{
  209|  14.0k|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |  120|  14.0k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  14.0k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  14.0k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  210|       |
  211|  14.0k|    if (st == NULL)
  ------------------
  |  Branch (211:9): [True: 0, False: 14.0k]
  ------------------
  212|      0|        return NULL;
  213|       |
  214|  14.0k|    st->comp = c;
  215|       |
  216|  14.0k|    if (n <= 0)
  ------------------
  |  Branch (216:9): [True: 14.0k, False: 0]
  ------------------
  217|  14.0k|        return st;
  218|       |
  219|      0|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (219:9): [True: 0, False: 0]
  ------------------
  220|      0|        OPENSSL_sk_free(st);
  221|      0|        return NULL;
  222|      0|    }
  223|       |
  224|      0|    return st;
  225|      0|}
OPENSSL_sk_insert:
  238|  34.9k|{
  239|  34.9k|    if (st == NULL || st->num == max_nodes)
  ------------------
  |  Branch (239:9): [True: 0, False: 34.9k]
  |  Branch (239:23): [True: 0, False: 34.9k]
  ------------------
  240|      0|        return 0;
  241|       |
  242|  34.9k|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (242:9): [True: 0, False: 34.9k]
  ------------------
  243|      0|        return 0;
  244|       |
  245|  34.9k|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (245:9): [True: 34.9k, False: 0]
  |  Branch (245:29): [True: 0, False: 0]
  ------------------
  246|  34.9k|        st->data[st->num] = data;
  247|  34.9k|    } else {
  248|      0|        memmove(&st->data[loc + 1], &st->data[loc],
  249|      0|                sizeof(st->data[0]) * (st->num - loc));
  250|      0|        st->data[loc] = data;
  251|      0|    }
  252|  34.9k|    st->num++;
  253|  34.9k|    st->sorted = 0;
  254|  34.9k|    return st->num;
  255|  34.9k|}
OPENSSL_sk_delete_ptr:
  270|  6.00k|{
  271|  6.00k|    int i;
  272|       |
  273|  12.3k|    for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (273:17): [True: 12.3k, False: 0]
  ------------------
  274|  12.3k|        if (st->data[i] == p)
  ------------------
  |  Branch (274:13): [True: 6.00k, False: 6.36k]
  ------------------
  275|  6.00k|            return internal_delete(st, i);
  276|      0|    return NULL;
  277|  6.00k|}
OPENSSL_sk_push:
  327|  34.9k|{
  328|  34.9k|    if (st == NULL)
  ------------------
  |  Branch (328:9): [True: 0, False: 34.9k]
  ------------------
  329|      0|        return -1;
  330|  34.9k|    return OPENSSL_sk_insert(st, data, st->num);
  331|  34.9k|}
OPENSSL_sk_pop:
  346|  8.10k|{
  347|  8.10k|    if (st == NULL || st->num == 0)
  ------------------
  |  Branch (347:9): [True: 1.59k, False: 6.50k]
  |  Branch (347:23): [True: 32, False: 6.47k]
  ------------------
  348|  1.62k|        return NULL;
  349|  6.47k|    return internal_delete(st, st->num - 1);
  350|  8.10k|}
OPENSSL_sk_pop_free:
  361|     36|{
  362|     36|    int i;
  363|       |
  364|     36|    if (st == NULL)
  ------------------
  |  Branch (364:9): [True: 36, False: 0]
  ------------------
  365|     36|        return;
  366|      0|    for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (366:17): [True: 0, False: 0]
  ------------------
  367|      0|        if (st->data[i] != NULL)
  ------------------
  |  Branch (367:13): [True: 0, False: 0]
  ------------------
  368|      0|            func((char *)st->data[i]);
  369|      0|    OPENSSL_sk_free(st);
  370|      0|}
OPENSSL_sk_free:
  373|  31.8k|{
  374|  31.8k|    if (st == NULL)
  ------------------
  |  Branch (374:9): [True: 17.8k, False: 14.0k]
  ------------------
  375|  17.8k|        return;
  376|  14.0k|    OPENSSL_free(st->data);
  ------------------
  |  |  128|  14.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  14.0k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  14.0k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  377|  14.0k|    OPENSSL_free(st);
  ------------------
  |  |  128|  14.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  14.0k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  14.0k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  378|  14.0k|}
OPENSSL_sk_num:
  381|  45.7k|{
  382|  45.7k|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (382:12): [True: 31.6k, False: 14.0k]
  ------------------
  383|  45.7k|}
OPENSSL_sk_value:
  386|  22.4k|{
  387|  22.4k|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (387:9): [True: 0, False: 22.4k]
  |  Branch (387:23): [True: 0, False: 22.4k]
  |  Branch (387:32): [True: 0, False: 22.4k]
  ------------------
  388|      0|        return NULL;
  389|  22.4k|    return (void *)st->data[i];
  390|  22.4k|}
stack.c:sk_reserve:
  161|  34.9k|{
  162|  34.9k|    const void **tmpdata;
  163|  34.9k|    int num_alloc;
  164|       |
  165|       |    /* Check to see the reservation isn't exceeding the hard limit */
  166|  34.9k|    if (n > max_nodes - st->num)
  ------------------
  |  Branch (166:9): [True: 0, False: 34.9k]
  ------------------
  167|      0|        return 0;
  168|       |
  169|       |    /* Figure out the new size */
  170|  34.9k|    num_alloc = st->num + n;
  171|  34.9k|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (171:9): [True: 24.2k, False: 10.7k]
  ------------------
  172|  24.2k|        num_alloc = min_nodes;
  173|       |
  174|       |    /* If |st->data| allocation was postponed */
  175|  34.9k|    if (st->data == NULL) {
  ------------------
  |  Branch (175:9): [True: 11.1k, False: 23.8k]
  ------------------
  176|       |        /*
  177|       |         * At this point, |st->num_alloc| and |st->num| are 0;
  178|       |         * so |num_alloc| value is |n| or |min_nodes| if greater than |n|.
  179|       |         */
  180|  11.1k|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL) {
  ------------------
  |  |  120|  11.1k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  11.1k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  11.1k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (180:13): [True: 0, False: 11.1k]
  ------------------
  181|      0|            CRYPTOerr(CRYPTO_F_SK_RESERVE, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  113|      0|# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |   29|      0|#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
  |  |  ------------------
  ------------------
  182|      0|            return 0;
  183|      0|        }
  184|  11.1k|        st->num_alloc = num_alloc;
  185|  11.1k|        return 1;
  186|  11.1k|    }
  187|       |
  188|  23.8k|    if (!exact) {
  ------------------
  |  Branch (188:9): [True: 23.8k, False: 0]
  ------------------
  189|  23.8k|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (189:13): [True: 21.1k, False: 2.71k]
  ------------------
  190|  21.1k|            return 1;
  191|  2.71k|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  192|  2.71k|        if (num_alloc == 0)
  ------------------
  |  Branch (192:13): [True: 0, False: 2.71k]
  ------------------
  193|      0|            return 0;
  194|  2.71k|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (194:16): [True: 0, False: 0]
  ------------------
  195|      0|        return 1;
  196|      0|    }
  197|       |
  198|  2.71k|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  122|  2.71k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  2.71k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  2.71k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  199|  2.71k|    if (tmpdata == NULL)
  ------------------
  |  Branch (199:9): [True: 0, False: 2.71k]
  ------------------
  200|      0|        return 0;
  201|       |
  202|  2.71k|    st->data = tmpdata;
  203|  2.71k|    st->num_alloc = num_alloc;
  204|  2.71k|    return 1;
  205|  2.71k|}
stack.c:compute_growth:
  145|  2.71k|{
  146|  2.71k|    const int limit = (max_nodes / 3) * 2 + (max_nodes % 3 ? 1 : 0);
  ------------------
  |  Branch (146:46): [Folded - Ignored]
  ------------------
  147|       |
  148|  5.43k|    while (current < target) {
  ------------------
  |  Branch (148:12): [True: 2.71k, False: 2.71k]
  ------------------
  149|       |        /* Check to see if we're at the hard limit */
  150|  2.71k|        if (current >= max_nodes)
  ------------------
  |  Branch (150:13): [True: 0, False: 2.71k]
  ------------------
  151|      0|            return 0;
  152|       |
  153|       |        /* Expand the size by a factor of 3/2 if it is within range */
  154|  2.71k|        current = current < limit ? current + current / 2 : max_nodes;
  ------------------
  |  Branch (154:19): [True: 2.71k, False: 0]
  ------------------
  155|  2.71k|    }
  156|  2.71k|    return current;
  157|  2.71k|}
stack.c:internal_delete:
  258|  12.4k|{
  259|  12.4k|    const void *ret = st->data[loc];
  260|       |
  261|  12.4k|    if (loc != st->num - 1)
  ------------------
  |  Branch (261:9): [True: 6.00k, False: 6.47k]
  ------------------
  262|  6.00k|         memmove(&st->data[loc], &st->data[loc + 1],
  263|  6.00k|                 sizeof(st->data[0]) * (st->num - loc - 1));
  264|  12.4k|    st->num--;
  265|       |
  266|  12.4k|    return (void *)ret;
  267|  12.4k|}

ERR_load_OSSL_STORE_strings:
  138|      2|{
  139|      2|#ifndef OPENSSL_NO_ERR
  140|      2|    if (ERR_func_error_string(OSSL_STORE_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (140:9): [True: 2, False: 0]
  ------------------
  141|      2|        ERR_load_strings_const(OSSL_STORE_str_functs);
  142|      2|        ERR_load_strings_const(OSSL_STORE_str_reasons);
  143|      2|    }
  144|      2|#endif
  145|      2|    return 1;
  146|      2|}

ossl_store_cleanup_int:
   31|      2|{
   32|      2|    ossl_store_destroy_loaders_int();
   33|      2|}

ossl_store_destroy_loaders_int:
  278|      2|{
  279|      2|    assert(lh_OSSL_STORE_LOADER_num_items(loader_register) == 0);
  280|      2|    lh_OSSL_STORE_LOADER_free(loader_register);
  281|      2|    loader_register = NULL;
  282|      2|    CRYPTO_THREAD_lock_free(registry_lock);
  283|      2|    registry_lock = NULL;
  284|      2|}

CRYPTO_THREAD_lock_new:
   25|  15.4k|{
   26|  15.4k|# ifdef USE_RWLOCK
   27|  15.4k|    CRYPTO_RWLOCK *lock;
   28|       |
   29|  15.4k|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL) {
  ------------------
  |  |  120|  15.4k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  15.4k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  15.4k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (29:9): [True: 0, False: 15.4k]
  ------------------
   30|       |        /* Don't set error, to avoid recursion blowup. */
   31|      0|        return NULL;
   32|      0|    }
   33|       |
   34|  15.4k|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (34:9): [True: 0, False: 15.4k]
  ------------------
   35|      0|        OPENSSL_free(lock);
  ------------------
  |  |  128|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|      0|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|      0|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|      0|        return NULL;
   37|      0|    }
   38|       |# else
   39|       |    pthread_mutexattr_t attr;
   40|       |    CRYPTO_RWLOCK *lock;
   41|       |
   42|       |    if ((lock = OPENSSL_zalloc(sizeof(pthread_mutex_t))) == NULL) {
   43|       |        /* Don't set error, to avoid recursion blowup. */
   44|       |        return NULL;
   45|       |    }
   46|       |
   47|       |    pthread_mutexattr_init(&attr);
   48|       |    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
   49|       |
   50|       |    if (pthread_mutex_init(lock, &attr) != 0) {
   51|       |        pthread_mutexattr_destroy(&attr);
   52|       |        OPENSSL_free(lock);
   53|       |        return NULL;
   54|       |    }
   55|       |
   56|       |    pthread_mutexattr_destroy(&attr);
   57|       |# endif
   58|       |
   59|  15.4k|    return lock;
   60|  15.4k|}
CRYPTO_THREAD_read_lock:
   63|     58|{
   64|     58|# ifdef USE_RWLOCK
   65|     58|    if (pthread_rwlock_rdlock(lock) != 0)
  ------------------
  |  Branch (65:9): [True: 0, False: 58]
  ------------------
   66|      0|        return 0;
   67|       |# else
   68|       |    if (pthread_mutex_lock(lock) != 0)
   69|       |        return 0;
   70|       |# endif
   71|       |
   72|     58|    return 1;
   73|     58|}
CRYPTO_THREAD_write_lock:
   76|  31.4k|{
   77|  31.4k|# ifdef USE_RWLOCK
   78|  31.4k|    if (pthread_rwlock_wrlock(lock) != 0)
  ------------------
  |  Branch (78:9): [True: 0, False: 31.4k]
  ------------------
   79|      0|        return 0;
   80|       |# else
   81|       |    if (pthread_mutex_lock(lock) != 0)
   82|       |        return 0;
   83|       |# endif
   84|       |
   85|  31.4k|    return 1;
   86|  31.4k|}
CRYPTO_THREAD_unlock:
   89|  31.5k|{
   90|  31.5k|# ifdef USE_RWLOCK
   91|  31.5k|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (91:9): [True: 0, False: 31.5k]
  ------------------
   92|      0|        return 0;
   93|       |# else
   94|       |    if (pthread_mutex_unlock(lock) != 0)
   95|       |        return 0;
   96|       |# endif
   97|       |
   98|  31.5k|    return 1;
   99|  31.5k|}
CRYPTO_THREAD_lock_free:
  102|  15.4k|{
  103|  15.4k|    if (lock == NULL)
  ------------------
  |  Branch (103:9): [True: 11, False: 15.4k]
  ------------------
  104|     11|        return;
  105|       |
  106|  15.4k|# ifdef USE_RWLOCK
  107|  15.4k|    pthread_rwlock_destroy(lock);
  108|       |# else
  109|       |    pthread_mutex_destroy(lock);
  110|       |# endif
  111|  15.4k|    OPENSSL_free(lock);
  ------------------
  |  |  128|  15.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  109|  15.4k|#  define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  110|  15.4k|#  define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|       |
  113|  15.4k|    return;
  114|  15.4k|}
CRYPTO_THREAD_run_once:
  117|   550k|{
  118|   550k|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 550k]
  ------------------
  119|      0|        return 0;
  120|       |
  121|   550k|    return 1;
  122|   550k|}
CRYPTO_THREAD_init_local:
  125|      4|{
  126|      4|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (126:9): [True: 0, False: 4]
  ------------------
  127|      0|        return 0;
  128|       |
  129|      4|    return 1;
  130|      4|}
CRYPTO_THREAD_get_local:
  133|   259k|{
  134|   259k|    return pthread_getspecific(*key);
  135|   259k|}
CRYPTO_THREAD_set_local:
  138|     10|{
  139|     10|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (139:9): [True: 0, False: 10]
  ------------------
  140|      0|        return 0;
  141|       |
  142|     10|    return 1;
  143|     10|}
CRYPTO_THREAD_cleanup_local:
  146|      4|{
  147|      4|    if (pthread_key_delete(*key) != 0)
  ------------------
  |  Branch (147:9): [True: 0, False: 4]
  ------------------
  148|      0|        return 0;
  149|       |
  150|      4|    return 1;
  151|      4|}

ERR_load_TS_strings:
  176|      2|{
  177|      2|#ifndef OPENSSL_NO_ERR
  178|      2|    if (ERR_func_error_string(TS_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (178:9): [True: 2, False: 0]
  ------------------
  179|      2|        ERR_load_strings_const(TS_str_functs);
  180|      2|        ERR_load_strings_const(TS_str_reasons);
  181|      2|    }
  182|      2|#endif
  183|      2|    return 1;
  184|      2|}

ERR_load_UI_strings:
   70|      2|{
   71|      2|#ifndef OPENSSL_NO_ERR
   72|      2|    if (ERR_func_error_string(UI_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (72:9): [True: 2, False: 0]
  ------------------
   73|      2|        ERR_load_strings_const(UI_str_functs);
   74|      2|        ERR_load_strings_const(UI_str_reasons);
   75|      2|    }
   76|      2|#endif
   77|      2|    return 1;
   78|      2|}

ERR_load_X509_strings:
  176|      2|{
  177|      2|#ifndef OPENSSL_NO_ERR
  178|      2|    if (ERR_func_error_string(X509_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (178:9): [True: 2, False: 0]
  ------------------
  179|      2|        ERR_load_strings_const(X509_str_functs);
  180|      2|        ERR_load_strings_const(X509_str_reasons);
  181|      2|    }
  182|      2|#endif
  183|      2|    return 1;
  184|      2|}

ERR_load_X509V3_strings:
  253|      2|{
  254|      2|#ifndef OPENSSL_NO_ERR
  255|      2|    if (ERR_func_error_string(X509V3_str_functs[0].error) == NULL) {
  ------------------
  |  Branch (255:9): [True: 2, False: 0]
  ------------------
  256|      2|        ERR_load_strings_const(X509V3_str_functs);
  257|      2|        ERR_load_strings_const(X509V3_str_reasons);
  258|      2|    }
  259|      2|#endif
  260|      2|    return 1;
  261|      2|}

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

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

b_print.c:ossl_assert_int:
   33|  4.16k|{
   34|  4.16k|    if (!expr)
  ------------------
  |  Branch (34:9): [True: 0, False: 4.16k]
  ------------------
   35|      0|        OPENSSL_die(exprstr, file, line);
   36|       |
   37|  4.16k|    return expr;
   38|  4.16k|}

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

err.c:do_err_strings_init_ossl_:
   62|      2|    {                                           \
   63|      2|        init##_ossl_ret_ = init();              \
   64|      2|    }                                           \
err.c:err_do_init_ossl_:
   62|      2|    {                                           \
   63|      2|        init##_ossl_ret_ = init();              \
   64|      2|    }                                           \
ex_data.c:do_ex_data_init_ossl_:
   62|      1|    {                                           \
   63|      1|        init##_ossl_ret_ = init();              \
   64|      1|    }                                           \
init.c:ossl_init_base_ossl_:
   62|      2|    {                                           \
   63|      2|        init##_ossl_ret_ = init();              \
   64|      2|    }                                           \
init.c:ossl_init_register_atexit_ossl_:
   62|      2|    {                                           \
   63|      2|        init##_ossl_ret_ = init();              \
   64|      2|    }                                           \
init.c:ossl_init_load_crypto_nodelete_ossl_:
   62|      2|    {                                           \
   63|      2|        init##_ossl_ret_ = init();              \
   64|      2|    }                                           \
init.c:ossl_init_load_crypto_strings_ossl_:
   62|      2|    {                                           \
   63|      2|        init##_ossl_ret_ = init();              \
   64|      2|    }                                           \

err.c:lh_ERR_STRING_DATA_free:
  130|      2|    { \
  131|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  132|      2|    } \
err.c:lh_ERR_STRING_DATA_new:
  125|      2|    { \
  126|      2|        return (LHASH_OF(type) *) \
  127|      2|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  128|      2|    } \
err.c:lh_ERR_STRING_DATA_insert:
  134|  15.1k|    { \
  135|  15.1k|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  136|  15.1k|    } \
err.c:lh_ERR_STRING_DATA_retrieve:
  142|     58|    { \
  143|     58|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  144|     58|    } \
store_register.c:lh_OSSL_STORE_LOADER_num_items:
  150|      2|    { \
  151|      2|        return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
  152|      2|    } \
store_register.c:lh_OSSL_STORE_LOADER_free:
  130|      2|    { \
  131|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  132|      2|    } \
conf_api.c:lh_CONF_VALUE_retrieve:
  142|  32.7k|    { \
  143|  32.7k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  144|  32.7k|    } \
conf_api.c:lh_CONF_VALUE_insert:
  134|  42.4k|    { \
  135|  42.4k|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  136|  42.4k|    } \
conf_api.c:lh_CONF_VALUE_new:
  125|  2.49k|    { \
  126|  2.49k|        return (LHASH_OF(type) *) \
  127|  2.49k|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  128|  2.49k|    } \
conf_api.c:lh_CONF_VALUE_set_down_load:
  170|  2.49k|    { \
  171|  2.49k|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
  172|  2.49k|    } \
conf_api.c:lh_CONF_VALUE_doall_LH_CONF_VALUE:
  191|  2.49k|    { \
  192|  2.49k|        OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNCARG)fn, (void *)arg); \
  193|  2.49k|    } \
conf_api.c:lh_CONF_VALUE_doall:
  175|  2.49k|    { \
  176|  2.49k|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  177|  2.49k|    } \
conf_api.c:lh_CONF_VALUE_free:
  130|  2.49k|    { \
  131|  2.49k|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  132|  2.49k|    } \
conf_api.c:lh_CONF_VALUE_delete:
  138|  22.4k|    { \
  139|  22.4k|        return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
  140|  22.4k|    } \
conf_api.c:lh_CONF_VALUE_error:
  146|  13.9k|    { \
  147|  13.9k|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  148|  13.9k|    } \

ex_data.c:sk_EX_CALLBACK_pop_free:
   85|     32|    { \
   86|     32|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
   87|     32|    } \
ex_data.c:sk_EX_CALLBACK_num:
   28|  30.8k|    { \
   29|  30.8k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   30|  30.8k|    } \
ex_data.c:sk_void_free:
   52|  15.4k|    { \
   53|  15.4k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   54|  15.4k|    } \
conf_api.c:sk_CONF_VALUE_push:
   69|  28.4k|    { \
   70|  28.4k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
   71|  28.4k|    } \
conf_api.c:sk_CONF_VALUE_delete_ptr:
   64|  6.00k|    { \
   65|  6.00k|        return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, \
   66|  6.00k|                                           (const void *)ptr); \
   67|  6.00k|    } \
conf_api.c:sk_CONF_VALUE_num:
   28|  13.9k|    { \
   29|  13.9k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   30|  13.9k|    } \
conf_api.c:sk_CONF_VALUE_value:
   32|  22.4k|    { \
   33|  22.4k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   34|  22.4k|    } \
conf_api.c:sk_CONF_VALUE_new_null:
   40|  13.9k|    { \
   41|  13.9k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   42|  13.9k|    } \
conf_api.c:sk_CONF_VALUE_free:
   52|  13.9k|    { \
   53|  13.9k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   54|  13.9k|    } \
conf_def.c:sk_BIO_pop:
   77|  8.10k|    { \
   78|  8.10k|        return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); \
   79|  8.10k|    } \
conf_def.c:sk_BIO_new_null:
   40|    118|    { \
   41|    118|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   42|    118|    } \
conf_def.c:sk_BIO_push:
   69|  6.47k|    { \
   70|  6.47k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
   71|  6.47k|    } \
conf_def.c:sk_BIO_free:
   52|  2.49k|    { \
   53|  2.49k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   54|  2.49k|    } \
conf_def.c:sk_BIO_num:
   28|    906|    { \
   29|    906|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   30|    906|    } \
conf_mod.c:sk_CONF_MODULE_num:
   28|      4|    { \
   29|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   30|      4|    } \
conf_mod.c:sk_CONF_IMODULE_num:
   28|      4|    { \
   29|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   30|      4|    } \
conf_mod.c:sk_CONF_IMODULE_free:
   52|      4|    { \
   53|      4|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   54|      4|    } \
obj_xref.c:sk_nid_triple_pop_free:
   85|      2|    { \
   86|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
   87|      2|    } \
obj_xref.c:sk_nid_triple_free:
   52|      2|    { \
   53|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   54|      2|    } \
evp_pbe.c:sk_EVP_PBE_CTL_pop_free:
   85|      2|    { \
   86|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
   87|      2|    } \

