ssh_digest_bytes:
  101|    798|{
  102|    798|	const struct ssh_digest *digest = ssh_digest_by_alg(alg);
  103|       |
  104|    798|	return digest == NULL ? 0 : digest->digest_len;
  ------------------
  |  Branch (104:9): [True: 0, False: 798]
  ------------------
  105|    798|}
ssh_digest_start:
  115|    798|{
  116|    798|	const struct ssh_digest *digest = ssh_digest_by_alg(alg);
  117|    798|	struct ssh_digest_ctx *ret;
  118|       |
  119|    798|	if (digest == NULL || ((ret = calloc(1, sizeof(*ret))) == NULL))
  ------------------
  |  Branch (119:6): [True: 0, False: 798]
  |  Branch (119:24): [True: 0, False: 798]
  ------------------
  120|      0|		return NULL;
  121|    798|	ret->alg = alg;
  122|    798|	if ((ret->mdctx = EVP_MD_CTX_new()) == NULL) {
  ------------------
  |  Branch (122:6): [True: 0, False: 798]
  ------------------
  123|      0|		free(ret);
  124|      0|		return NULL;
  125|      0|	}
  126|    798|	if (EVP_DigestInit_ex(ret->mdctx, digest->mdfunc(), NULL) != 1) {
  ------------------
  |  Branch (126:6): [True: 0, False: 798]
  ------------------
  127|      0|		ssh_digest_free(ret);
  128|      0|		return NULL;
  129|      0|	}
  130|    798|	return ret;
  131|    798|}
ssh_digest_update:
  146|  3.99k|{
  147|  3.99k|	if (EVP_DigestUpdate(ctx->mdctx, m, mlen) != 1)
  ------------------
  |  Branch (147:6): [True: 0, False: 3.99k]
  ------------------
  148|      0|		return SSH_ERR_LIBCRYPTO_ERROR;
  ------------------
  |  |   46|      0|#define SSH_ERR_LIBCRYPTO_ERROR			-22
  ------------------
  149|  3.99k|	return 0;
  150|  3.99k|}
ssh_digest_final:
  160|    798|{
  161|    798|	const struct ssh_digest *digest = ssh_digest_by_alg(ctx->alg);
  162|    798|	u_int l = dlen;
  163|       |
  164|    798|	if (digest == NULL || dlen > UINT_MAX)
  ------------------
  |  Branch (164:6): [True: 0, False: 798]
  |  Branch (164:24): [True: 0, False: 798]
  ------------------
  165|      0|		return SSH_ERR_INVALID_ARGUMENT;
  ------------------
  |  |   34|      0|#define SSH_ERR_INVALID_ARGUMENT		-10
  ------------------
  166|    798|	if (dlen < digest->digest_len) /* No truncation allowed */
  ------------------
  |  Branch (166:6): [True: 0, False: 798]
  ------------------
  167|      0|		return SSH_ERR_INVALID_ARGUMENT;
  ------------------
  |  |   34|      0|#define SSH_ERR_INVALID_ARGUMENT		-10
  ------------------
  168|    798|	if (EVP_DigestFinal_ex(ctx->mdctx, d, &l) != 1)
  ------------------
  |  Branch (168:6): [True: 0, False: 798]
  ------------------
  169|      0|		return SSH_ERR_LIBCRYPTO_ERROR;
  ------------------
  |  |   46|      0|#define SSH_ERR_LIBCRYPTO_ERROR			-22
  ------------------
  170|    798|	if (l != digest->digest_len) /* sanity */
  ------------------
  |  Branch (170:6): [True: 0, False: 798]
  ------------------
  171|      0|		return SSH_ERR_INTERNAL_ERROR;
  ------------------
  |  |   25|      0|#define SSH_ERR_INTERNAL_ERROR			-1
  ------------------
  172|    798|	return 0;
  173|    798|}
ssh_digest_free:
  177|    798|{
  178|    798|	if (ctx == NULL)
  ------------------
  |  Branch (178:6): [True: 0, False: 798]
  ------------------
  179|      0|		return;
  180|    798|	EVP_MD_CTX_free(ctx->mdctx);
  181|    798|	freezero(ctx, sizeof(*ctx));
  182|    798|}
digest-openssl.c:ssh_digest_by_alg:
   69|  2.39k|{
   70|  2.39k|	if (alg < 0 || alg >= SSH_DIGEST_MAX)
  ------------------
  |  |   30|  2.39k|#define SSH_DIGEST_MAX		5
  ------------------
  |  Branch (70:6): [True: 0, False: 2.39k]
  |  Branch (70:17): [True: 0, False: 2.39k]
  ------------------
   71|      0|		return NULL;
   72|  2.39k|	if (digests[alg].id != alg) /* sanity */
  ------------------
  |  Branch (72:6): [True: 0, False: 2.39k]
  ------------------
   73|      0|		return NULL;
   74|  2.39k|	if (digests[alg].mdfunc == NULL)
  ------------------
  |  Branch (74:6): [True: 0, False: 2.39k]
  ------------------
   75|      0|		return NULL;
   76|  2.39k|	return &(digests[alg]);
   77|  2.39k|}

kex_names_valid:
  164|      1|{
  165|      1|	char *s, *cp, *p;
  166|       |
  167|      1|	if (names == NULL || strcmp(names, "") == 0)
  ------------------
  |  Branch (167:6): [True: 0, False: 1]
  |  Branch (167:23): [True: 0, False: 1]
  ------------------
  168|      0|		return 0;
  169|      1|	if ((s = cp = strdup(names)) == NULL)
  ------------------
  |  Branch (169:6): [True: 0, False: 1]
  ------------------
  170|      0|		return 0;
  171|      1|	for ((p = strsep(&cp, ",")); p && *p != '\0';
  ------------------
  |  Branch (171:31): [True: 1, False: 0]
  |  Branch (171:36): [True: 0, False: 1]
  ------------------
  172|      1|	    (p = strsep(&cp, ","))) {
  173|      0|		if (kex_alg_by_name(p) == NULL) {
  ------------------
  |  Branch (173:7): [True: 0, False: 0]
  ------------------
  174|      0|			error("Unsupported KEX algorithm \"%.100s\"", p);
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
  175|      0|			free(s);
  176|      0|			return 0;
  177|      0|		}
  178|      0|	}
  179|      1|	debug3("kex names ok: [%s]", names);
  ------------------
  |  |  109|      1|#define debug3(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG3, NULL, __VA_ARGS__)
  ------------------
  180|      1|	free(s);
  181|      1|	return 1;
  182|      1|}

log_init:
  196|      1|{
  197|       |#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
  198|       |	struct syslog_data sdata = SYSLOG_DATA_INIT;
  199|       |#endif
  200|       |
  201|      1|	argv0 = av0;
  202|       |
  203|      1|	if (log_change_level(level) != 0) {
  ------------------
  |  Branch (203:6): [True: 0, False: 1]
  ------------------
  204|      0|		fprintf(stderr, "Unrecognized internal syslog level code %d\n",
  205|      0|		    (int) level);
  206|      0|		exit(1);
  207|      0|	}
  208|       |
  209|      1|	log_handler = NULL;
  210|      1|	log_handler_ctx = NULL;
  211|       |
  212|      1|	log_on_stderr = on_stderr;
  213|      1|	if (on_stderr)
  ------------------
  |  Branch (213:6): [True: 0, False: 1]
  ------------------
  214|      0|		return;
  215|       |
  216|      1|	switch (facility) {
  217|      0|	case SYSLOG_FACILITY_DAEMON:
  ------------------
  |  Branch (217:2): [True: 0, False: 1]
  ------------------
  218|      0|		log_facility = LOG_DAEMON;
  219|      0|		break;
  220|      0|	case SYSLOG_FACILITY_USER:
  ------------------
  |  Branch (220:2): [True: 0, False: 1]
  ------------------
  221|      0|		log_facility = LOG_USER;
  222|      0|		break;
  223|      1|	case SYSLOG_FACILITY_AUTH:
  ------------------
  |  Branch (223:2): [True: 1, False: 0]
  ------------------
  224|      1|		log_facility = LOG_AUTH;
  225|      1|		break;
  226|      0|#ifdef LOG_AUTHPRIV
  227|      0|	case SYSLOG_FACILITY_AUTHPRIV:
  ------------------
  |  Branch (227:2): [True: 0, False: 1]
  ------------------
  228|      0|		log_facility = LOG_AUTHPRIV;
  229|      0|		break;
  230|      0|#endif
  231|      0|	case SYSLOG_FACILITY_LOCAL0:
  ------------------
  |  Branch (231:2): [True: 0, False: 1]
  ------------------
  232|      0|		log_facility = LOG_LOCAL0;
  233|      0|		break;
  234|      0|	case SYSLOG_FACILITY_LOCAL1:
  ------------------
  |  Branch (234:2): [True: 0, False: 1]
  ------------------
  235|      0|		log_facility = LOG_LOCAL1;
  236|      0|		break;
  237|      0|	case SYSLOG_FACILITY_LOCAL2:
  ------------------
  |  Branch (237:2): [True: 0, False: 1]
  ------------------
  238|      0|		log_facility = LOG_LOCAL2;
  239|      0|		break;
  240|      0|	case SYSLOG_FACILITY_LOCAL3:
  ------------------
  |  Branch (240:2): [True: 0, False: 1]
  ------------------
  241|      0|		log_facility = LOG_LOCAL3;
  242|      0|		break;
  243|      0|	case SYSLOG_FACILITY_LOCAL4:
  ------------------
  |  Branch (243:2): [True: 0, False: 1]
  ------------------
  244|      0|		log_facility = LOG_LOCAL4;
  245|      0|		break;
  246|      0|	case SYSLOG_FACILITY_LOCAL5:
  ------------------
  |  Branch (246:2): [True: 0, False: 1]
  ------------------
  247|      0|		log_facility = LOG_LOCAL5;
  248|      0|		break;
  249|      0|	case SYSLOG_FACILITY_LOCAL6:
  ------------------
  |  Branch (249:2): [True: 0, False: 1]
  ------------------
  250|      0|		log_facility = LOG_LOCAL6;
  251|      0|		break;
  252|      0|	case SYSLOG_FACILITY_LOCAL7:
  ------------------
  |  Branch (252:2): [True: 0, False: 1]
  ------------------
  253|      0|		log_facility = LOG_LOCAL7;
  254|      0|		break;
  255|      0|	default:
  ------------------
  |  Branch (255:2): [True: 0, False: 1]
  ------------------
  256|      0|		fprintf(stderr,
  257|      0|		    "Unrecognized internal syslog facility code %d\n",
  258|      0|		    (int) facility);
  259|      0|		exit(1);
  260|      1|	}
  261|       |
  262|       |	/*
  263|       |	 * If an external library (eg libwrap) attempts to use syslog
  264|       |	 * immediately after reexec, syslog may be pointing to the wrong
  265|       |	 * facility, so we force an open/close of syslog here.
  266|       |	 */
  267|       |#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
  268|       |	openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata);
  269|       |	closelog_r(&sdata);
  270|       |#else
  271|      1|	openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility);
  ------------------
  |  Branch (271:10): [True: 1, False: 0]
  ------------------
  272|      1|	closelog();
  273|      1|#endif
  274|      1|}
log_change_level:
  278|      1|{
  279|       |	/* no-op if log_init has not been called */
  280|      1|	if (argv0 == NULL)
  ------------------
  |  Branch (280:6): [True: 0, False: 1]
  ------------------
  281|      0|		return 0;
  282|       |
  283|      1|	switch (new_log_level) {
  284|      1|	case SYSLOG_LEVEL_QUIET:
  ------------------
  |  Branch (284:2): [True: 1, False: 0]
  ------------------
  285|      1|	case SYSLOG_LEVEL_FATAL:
  ------------------
  |  Branch (285:2): [True: 0, False: 1]
  ------------------
  286|      1|	case SYSLOG_LEVEL_ERROR:
  ------------------
  |  Branch (286:2): [True: 0, False: 1]
  ------------------
  287|      1|	case SYSLOG_LEVEL_INFO:
  ------------------
  |  Branch (287:2): [True: 0, False: 1]
  ------------------
  288|      1|	case SYSLOG_LEVEL_VERBOSE:
  ------------------
  |  Branch (288:2): [True: 0, False: 1]
  ------------------
  289|      1|	case SYSLOG_LEVEL_DEBUG1:
  ------------------
  |  Branch (289:2): [True: 0, False: 1]
  ------------------
  290|      1|	case SYSLOG_LEVEL_DEBUG2:
  ------------------
  |  Branch (290:2): [True: 0, False: 1]
  ------------------
  291|      1|	case SYSLOG_LEVEL_DEBUG3:
  ------------------
  |  Branch (291:2): [True: 0, False: 1]
  ------------------
  292|      1|		log_level = new_log_level;
  293|      1|		return 0;
  294|      0|	default:
  ------------------
  |  Branch (294:2): [True: 0, False: 1]
  ------------------
  295|      0|		return -1;
  296|      1|	}
  297|      1|}
sshlog:
  430|  1.82k|{
  431|  1.82k|	va_list args;
  432|       |
  433|  1.82k|	va_start(args, fmt);
  434|  1.82k|	sshlogv(file, func, line, showfunc, level, suffix, fmt, args);
  435|       |	va_end(args);
  436|  1.82k|}
sshlogv:
  454|  1.82k|{
  455|  1.82k|	char tag[128], fmt2[MSGBUFSIZ + 128];
  456|  1.82k|	int forced = 0;
  457|  1.82k|	const char *cp;
  458|  1.82k|	size_t i;
  459|       |
  460|       |	/* short circuit processing early if we're not going to log anything */
  461|  1.82k|	if (nlog_verbose == 0 && level > log_level)
  ------------------
  |  Branch (461:6): [True: 1.82k, False: 0]
  |  Branch (461:27): [True: 1.82k, False: 0]
  ------------------
  462|  1.82k|		return;
  463|       |
  464|      0|	snprintf(tag, sizeof(tag), "%.48s:%.48s():%d (bin=%s, pid=%ld)",
  465|      0|	    (cp = strrchr(file, '/')) == NULL ? file : cp + 1, func, line,
  ------------------
  |  Branch (465:6): [True: 0, False: 0]
  ------------------
  466|      0|	    argv0 == NULL ? "UNKNOWN" : argv0, (long)getpid());
  ------------------
  |  Branch (466:6): [True: 0, False: 0]
  ------------------
  467|      0|	for (i = 0; i < nlog_verbose; i++) {
  ------------------
  |  Branch (467:14): [True: 0, False: 0]
  ------------------
  468|      0|		if (match_pattern_list(tag, log_verbose[i], 0) == 1) {
  ------------------
  |  Branch (468:7): [True: 0, False: 0]
  ------------------
  469|      0|			forced = 1;
  470|      0|			break;
  471|      0|		}
  472|      0|	}
  473|       |
  474|      0|	if (forced)
  ------------------
  |  Branch (474:6): [True: 0, False: 0]
  ------------------
  475|      0|		snprintf(fmt2, sizeof(fmt2), "%s: %s", tag, fmt);
  476|      0|	else if (showfunc)
  ------------------
  |  Branch (476:11): [True: 0, False: 0]
  ------------------
  477|      0|		snprintf(fmt2, sizeof(fmt2), "%s: %s", func, fmt);
  478|      0|	else
  479|      0|		strlcpy(fmt2, fmt, sizeof(fmt2));
  480|       |
  481|      0|	do_log(level, forced, suffix, fmt2, args);
  482|      0|}

match_pattern:
   83|  8.72k|{
   84|  8.72k|	size_t M;
   85|  8.72k|	size_t i;
   86|  8.72k|	char *states, *next_states, *tmp;
   87|  8.72k|	int active, matched = 0;
   88|       |
   89|       |	/* trivial case: empty pattern vs empty input */
   90|  8.72k|	if ((M = strlen(pattern)) == 0)
  ------------------
  |  Branch (90:6): [True: 1.14k, False: 7.57k]
  ------------------
   91|  1.14k|		return *s == '\0';
   92|       |
   93|       |	/* A state for each pattern character, plus one final accepting state */
   94|  7.57k|	states = xcalloc(M + 1, sizeof(*states));
   95|  7.57k|	next_states = xcalloc(M + 1, sizeof(*next_states));
   96|       |
   97|       |	/* Initial state: state 0 is active */
   98|  7.57k|	states[0] = 1;
   99|       |	/* Other states might be reachable now if the pattern starts with '*' */
  100|  7.57k|	epsilon_closure(states, pattern, M);
  101|       |
  102|  11.1k|	for (; *s; s++) {
  ------------------
  |  Branch (102:9): [True: 10.5k, False: 504]
  ------------------
  103|  10.5k|		memset(next_states, 0, M + 1);
  104|       |
  105|       |		/* Calculate the reachable next states given the input char */
  106|   105k|		for (i = 0; i < M; i++) {
  ------------------
  |  Branch (106:15): [True: 94.4k, False: 10.5k]
  ------------------
  107|  94.4k|			if (!states[i])
  ------------------
  |  Branch (107:8): [True: 75.7k, False: 18.7k]
  ------------------
  108|  75.7k|				continue;
  109|  18.7k|			if (pattern[i] == '*') {
  ------------------
  |  Branch (109:8): [True: 8.10k, False: 10.6k]
  ------------------
  110|       |				/*
  111|       |				 * '*' matches any character, so we can
  112|       |				 * stay in state i
  113|       |				 */
  114|  8.10k|				next_states[i] = 1;
  115|  10.6k|			} else if (pattern[i] == '?' || pattern[i] == *s) {
  ------------------
  |  Branch (115:15): [True: 301, False: 10.3k]
  |  Branch (115:36): [True: 2.40k, False: 7.95k]
  ------------------
  116|       |				/*
  117|       |				 * '?' matches any character, or we have
  118|       |				 * a literal match.
  119|       |				 */
  120|  2.71k|				next_states[i + 1] = 1;
  121|  2.71k|			}
  122|  18.7k|		}
  123|       |
  124|       |		/* Expand the reachable next states with epsilon transitions */
  125|  10.5k|		epsilon_closure(next_states, pattern, M);
  126|       |
  127|       |		/* Swap states and next_states */
  128|  10.5k|		tmp = states;
  129|  10.5k|		states = next_states;
  130|  10.5k|		next_states = tmp;
  131|       |
  132|       |		/* Check if we have any active pattern states left */
  133|  10.5k|		active = 0;
  134|  87.2k|		for (i = 0; i <= M; i++) {
  ------------------
  |  Branch (134:15): [True: 80.1k, False: 7.07k]
  ------------------
  135|  80.1k|			if (states[i]) {
  ------------------
  |  Branch (135:8): [True: 3.52k, False: 76.6k]
  ------------------
  136|  3.52k|				active = 1;
  137|  3.52k|				break;
  138|  3.52k|			}
  139|  80.1k|		}
  140|  10.5k|		if (!active)
  ------------------
  |  Branch (140:7): [True: 7.07k, False: 3.52k]
  ------------------
  141|  7.07k|			goto out; /* No active states, fail early */
  142|  10.5k|	}
  143|       |	/*
  144|       |	 * We matched only if we ended up in the final, accepting state
  145|       |	 * after consuming all the input.
  146|       |	 */
  147|    504|	matched = states[M];
  148|  7.57k| out:
  149|  7.57k|	free(states);
  150|  7.57k|	free(next_states);
  151|  7.57k|	return matched;
  152|    504|}
match_pattern_list:
  162|     51|{
  163|     51|	char sub[1024];
  164|     51|	int negated;
  165|     51|	int got_positive;
  166|     51|	u_int i, subi, len = strlen(pattern);
  167|       |
  168|     51|	got_positive = 0;
  169|    101|	for (i = 0; i < len;) {
  ------------------
  |  Branch (169:14): [True: 51, False: 50]
  ------------------
  170|       |		/* Check if the subpattern is negated. */
  171|     51|		if (pattern[i] == '!') {
  ------------------
  |  Branch (171:7): [True: 7, False: 44]
  ------------------
  172|      7|			negated = 1;
  173|      7|			i++;
  174|      7|		} else
  175|     44|			negated = 0;
  176|       |
  177|       |		/*
  178|       |		 * Extract the subpattern up to a comma or end.  Convert the
  179|       |		 * subpattern to lowercase.
  180|       |		 */
  181|     51|		for (subi = 0;
  182|    607|		    i < len && subi < sizeof(sub) - 1 && pattern[i] != ',';
  ------------------
  |  Branch (182:7): [True: 556, False: 51]
  |  Branch (182:18): [True: 556, False: 0]
  |  Branch (182:44): [True: 556, False: 0]
  ------------------
  183|    556|		    subi++, i++)
  184|    556|			sub[subi] = dolower && isupper((u_char)pattern[i]) ?
  ------------------
  |  Branch (184:16): [True: 0, False: 556]
  |  Branch (184:27): [True: 0, False: 0]
  ------------------
  185|    556|			    tolower((u_char)pattern[i]) : pattern[i];
  ------------------
  |  Branch (185:8): [True: 0, False: 0]
  |  Branch (185:8): [True: 0, False: 0]
  |  Branch (185:8): [Folded, False: 0]
  ------------------
  186|       |		/* If subpattern too long, return failure (no match). */
  187|     51|		if (subi >= sizeof(sub) - 1)
  ------------------
  |  Branch (187:7): [True: 0, False: 51]
  ------------------
  188|      0|			return 0;
  189|       |
  190|       |		/* If the subpattern was terminated by a comma, then skip it. */
  191|     51|		if (i < len && pattern[i] == ',')
  ------------------
  |  Branch (191:7): [True: 0, False: 51]
  |  Branch (191:18): [True: 0, False: 0]
  ------------------
  192|      0|			i++;
  193|       |
  194|       |		/* Null-terminate the subpattern. */
  195|     51|		sub[subi] = '\0';
  196|       |
  197|       |		/* Try to match the subpattern against the string. */
  198|     51|		if (match_pattern(string, sub)) {
  ------------------
  |  Branch (198:7): [True: 20, False: 31]
  ------------------
  199|     20|			if (negated)
  ------------------
  |  Branch (199:8): [True: 1, False: 19]
  ------------------
  200|      1|				return -1;		/* Negative */
  201|     19|			else
  202|     19|				got_positive = 1;	/* Positive */
  203|     20|		}
  204|     51|	}
  205|       |
  206|       |	/*
  207|       |	 * Return success if got a positive match.  If there was a negative
  208|       |	 * match, we have already returned -1 and never get here.
  209|       |	 */
  210|     50|	return got_positive;
  211|     51|}
match.c:epsilon_closure:
   62|  18.1k|{
   63|  18.1k|	size_t i;
   64|       |
   65|       |	/* only need a forward pass as there are no back jumps in our grammar */
   66|   178k|	for (i = 0; i < M; i++) {
  ------------------
  |  Branch (66:14): [True: 160k, False: 18.1k]
  ------------------
   67|   160k|		if (!states[i] || pattern[i] != '*')
  ------------------
  |  Branch (67:7): [True: 141k, False: 19.2k]
  |  Branch (67:21): [True: 10.7k, False: 8.49k]
  ------------------
   68|   151k|			continue;
   69|       |		/*
   70|       |		 * State i is active, and pattern[i] is '*', so we can
   71|       |		 * epsilon-transition to i+1.
   72|       |		 */
   73|  8.49k|		states[i + 1] = 1;
   74|  8.49k|	}
   75|  18.1k|}

strdelim:
  528|  2.25k|{
  529|  2.25k|	return strdelim_internal(s, 1);
  530|  2.25k|}
a2port:
  593|     42|{
  594|     42|	struct servent *se;
  595|     42|	long long port;
  596|     42|	const char *errstr;
  597|       |
  598|     42|	port = strtonum(s, 0, 65535, &errstr);
  599|     42|	if (errstr == NULL)
  ------------------
  |  Branch (599:6): [True: 42, False: 0]
  ------------------
  600|     42|		return (int)port;
  601|      0|	if ((se = getservbyname(s, "tcp")) != NULL)
  ------------------
  |  Branch (601:6): [True: 0, False: 0]
  ------------------
  602|      0|		return ntohs(se->s_port);
  603|      0|	return -1;
  604|      0|}
convtime_double:
  672|     25|{
  673|     25|	double val, total_sec = 0.0, multiplier;
  674|     25|	const char *p, *start_p;
  675|     25|	char *endp;
  676|     25|	int seen_seconds = 0;
  677|       |
  678|     25|	if (s == NULL || *s == '\0')
  ------------------
  |  Branch (678:6): [True: 0, False: 25]
  |  Branch (678:19): [True: 0, False: 25]
  ------------------
  679|      0|		return -1.0;
  680|       |
  681|     50|	for (p = s; *p != '\0';) {
  ------------------
  |  Branch (681:14): [True: 25, False: 25]
  ------------------
  682|     25|		if (!isdigit((unsigned char)*p) && *p != '.')
  ------------------
  |  Branch (682:7): [True: 21, False: 4]
  |  Branch (682:38): [True: 0, False: 21]
  ------------------
  683|      0|			return -1.0;
  684|       |
  685|     25|		errno = 0;
  686|     25|		if ((val = strtod(p, &endp)) < 0 || errno != 0 || p == endp)
  ------------------
  |  Branch (686:7): [True: 0, False: 25]
  |  Branch (686:39): [True: 0, False: 25]
  |  Branch (686:53): [True: 0, False: 25]
  ------------------
  687|      0|			return -1.0;
  688|       |		/* Allow only decimal forms */
  689|     25|		if (p + strspn(p, "0123456789.") != endp)
  ------------------
  |  Branch (689:7): [True: 0, False: 25]
  ------------------
  690|      0|			return -1.0;
  691|     25|		start_p = p;
  692|     25|		p = endp;
  693|       |
  694|     25|		switch (*p) {
  695|     24|		case '\0':
  ------------------
  |  Branch (695:3): [True: 24, False: 1]
  ------------------
  696|       |			/* FALLTHROUGH */
  697|     24|		case 's':
  ------------------
  |  Branch (697:3): [True: 0, False: 25]
  ------------------
  698|     24|		case 'S':
  ------------------
  |  Branch (698:3): [True: 0, False: 25]
  ------------------
  699|     24|			if (seen_seconds++)
  ------------------
  |  Branch (699:8): [True: 0, False: 24]
  ------------------
  700|      0|				return -1.0;
  701|     24|			multiplier = SECONDS;
  ------------------
  |  |  637|     24|#define SECONDS		1.0
  ------------------
  702|     24|			break;
  703|      0|		case 'm':
  ------------------
  |  Branch (703:3): [True: 0, False: 25]
  ------------------
  704|      0|		case 'M':
  ------------------
  |  Branch (704:3): [True: 0, False: 25]
  ------------------
  705|      0|			multiplier = MINUTES;
  ------------------
  |  |  638|      0|#define MINUTES		(SECONDS * 60)
  |  |  ------------------
  |  |  |  |  637|      0|#define SECONDS		1.0
  |  |  ------------------
  ------------------
  706|      0|			break;
  707|      0|		case 'h':
  ------------------
  |  Branch (707:3): [True: 0, False: 25]
  ------------------
  708|      0|		case 'H':
  ------------------
  |  Branch (708:3): [True: 0, False: 25]
  ------------------
  709|      0|			multiplier = HOURS;
  ------------------
  |  |  639|      0|#define HOURS		(MINUTES * 60)
  |  |  ------------------
  |  |  |  |  638|      0|#define MINUTES		(SECONDS * 60)
  |  |  |  |  ------------------
  |  |  |  |  |  |  637|      0|#define SECONDS		1.0
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  710|      0|			break;
  711|      1|		case 'd':
  ------------------
  |  Branch (711:3): [True: 1, False: 24]
  ------------------
  712|      1|		case 'D':
  ------------------
  |  Branch (712:3): [True: 0, False: 25]
  ------------------
  713|      1|			multiplier = DAYS;
  ------------------
  |  |  640|      1|#define DAYS		(HOURS * 24)
  |  |  ------------------
  |  |  |  |  639|      1|#define HOURS		(MINUTES * 60)
  |  |  |  |  ------------------
  |  |  |  |  |  |  638|      1|#define MINUTES		(SECONDS * 60)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  637|      1|#define SECONDS		1.0
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  714|      1|			break;
  715|      0|		case 'w':
  ------------------
  |  Branch (715:3): [True: 0, False: 25]
  ------------------
  716|      0|		case 'W':
  ------------------
  |  Branch (716:3): [True: 0, False: 25]
  ------------------
  717|      0|			multiplier = WEEKS;
  ------------------
  |  |  641|      0|#define WEEKS		(DAYS * 7)
  |  |  ------------------
  |  |  |  |  640|      0|#define DAYS		(HOURS * 24)
  |  |  |  |  ------------------
  |  |  |  |  |  |  639|      0|#define HOURS		(MINUTES * 60)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  638|      0|#define MINUTES		(SECONDS * 60)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  637|      0|#define SECONDS		1.0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  718|      0|			break;
  719|      0|		default:
  ------------------
  |  Branch (719:3): [True: 0, False: 25]
  ------------------
  720|      0|			return -1.0;
  721|     25|		}
  722|       |
  723|       |		/* Special handling if this was a decimal */
  724|     25|		if (memchr(start_p, '.', endp - start_p) != NULL) {
  ------------------
  |  Branch (724:7): [True: 21, False: 4]
  ------------------
  725|       |			/* Decimal point present */
  726|     21|			if (multiplier > 1.0)
  ------------------
  |  Branch (726:8): [True: 0, False: 21]
  ------------------
  727|      0|				return -1.0; /* No fractionals for non-seconds */
  728|       |			/* For seconds, ensure digits follow */
  729|     21|			if (!isdigit((unsigned char)*(endp - 1)))
  ------------------
  |  Branch (729:8): [True: 0, False: 21]
  ------------------
  730|      0|				return -1.0;
  731|     21|		}
  732|       |
  733|     25|		total_sec += val * multiplier;
  734|       |
  735|     25|		if (*p != '\0')
  ------------------
  |  Branch (735:7): [True: 1, False: 24]
  ------------------
  736|      1|			p++;
  737|     25|	}
  738|     25|	return total_sec;
  739|     25|}
convtime:
  747|     24|{
  748|     24|	double sec_val;
  749|       |
  750|     24|	if ((sec_val = convtime_double(s)) < 0.0)
  ------------------
  |  Branch (750:6): [True: 0, False: 24]
  ------------------
  751|      0|		return -1;
  752|       |
  753|       |	/* Check for overflow into int */
  754|     24|	if (sec_val < 0 || sec_val > INT_MAX)
  ------------------
  |  Branch (754:6): [True: 0, False: 24]
  |  Branch (754:21): [True: 0, False: 24]
  ------------------
  755|      0|		return -1;
  756|       |
  757|     24|	return (int)sec_val;
  758|     24|}
hpdelim2:
  824|      7|{
  825|      7|	char *s, *old;
  826|       |
  827|      7|	if (cp == NULL || *cp == NULL)
  ------------------
  |  Branch (827:6): [True: 0, False: 7]
  |  Branch (827:20): [True: 0, False: 7]
  ------------------
  828|      0|		return NULL;
  829|       |
  830|      7|	old = s = *cp;
  831|      7|	if (*s == '[') {
  ------------------
  |  Branch (831:6): [True: 0, False: 7]
  ------------------
  832|      0|		if ((s = strchr(s, ']')) == NULL)
  ------------------
  |  Branch (832:7): [True: 0, False: 0]
  ------------------
  833|      0|			return NULL;
  834|      0|		else
  835|      0|			s++;
  836|      7|	} else if ((s = strpbrk(s, ":/")) == NULL)
  ------------------
  |  Branch (836:13): [True: 0, False: 7]
  ------------------
  837|      0|		s = *cp + strlen(*cp); /* skip to end (see first case below) */
  838|       |
  839|      7|	switch (*s) {
  840|      0|	case '\0':
  ------------------
  |  Branch (840:2): [True: 0, False: 7]
  ------------------
  841|      0|		*cp = NULL;	/* no more fields*/
  842|      0|		break;
  843|       |
  844|      7|	case ':':
  ------------------
  |  Branch (844:2): [True: 7, False: 0]
  ------------------
  845|      7|	case '/':
  ------------------
  |  Branch (845:2): [True: 0, False: 7]
  ------------------
  846|      7|		if (delim != NULL)
  ------------------
  |  Branch (846:7): [True: 7, False: 0]
  ------------------
  847|      7|			*delim = *s;
  848|      7|		*s = '\0';	/* terminate */
  849|      7|		*cp = s + 1;
  850|      7|		break;
  851|       |
  852|      0|	default:
  ------------------
  |  Branch (852:2): [True: 0, False: 7]
  ------------------
  853|      0|		return NULL;
  854|      7|	}
  855|       |
  856|      7|	return old;
  857|      7|}
hpdelim:
  862|      7|{
  863|      7|	char *r, delim = '\0';
  864|       |
  865|      7|	r =  hpdelim2(cp, &delim);
  866|      7|	if (delim == '/')
  ------------------
  |  Branch (866:6): [True: 0, False: 7]
  ------------------
  867|      0|		return NULL;
  868|      7|	return r;
  869|      7|}
cleanhostname:
  873|      7|{
  874|      7|	if (*host == '[' && host[strlen(host) - 1] == ']') {
  ------------------
  |  Branch (874:6): [True: 0, False: 7]
  |  Branch (874:22): [True: 0, False: 0]
  ------------------
  875|      0|		host[strlen(host) - 1] = '\0';
  876|      0|		return (host + 1);
  877|      0|	} else
  878|      7|		return host;
  879|      7|}
dollar_expand:
 1478|      4|{
 1479|      4|	char *ret;
 1480|      4|	int err;
 1481|      4|	va_list ap;
 1482|       |
 1483|      4|	va_start(ap, string);
 1484|      4|	ret = vdollar_percent_expand(&err, 1, 0, string, ap);
 1485|      4|	va_end(ap);
 1486|      4|	if (parseerr != NULL)
  ------------------
  |  Branch (1486:6): [True: 4, False: 0]
  ------------------
 1487|      4|		*parseerr = err;
 1488|      4|	return ret;
 1489|      4|}
percent_dollar_expand:
 1516|    798|{
 1517|    798|	char *ret;
 1518|    798|	int err;
 1519|    798|	va_list ap;
 1520|       |
 1521|    798|	va_start(ap, string);
 1522|    798|	ret = vdollar_percent_expand(&err, 1, 1, string, ap);
 1523|    798|	va_end(ap);
 1524|    798|	if (err)
  ------------------
  |  Branch (1524:6): [True: 0, False: 798]
  ------------------
 1525|      0|		fatal_f("failed");
  ------------------
  |  |  126|      0|#define fatal_f(...)		sshfatal(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 1526|    798|	return ret;
 1527|    798|}
tohex:
 1632|    798|{
 1633|    798|	const u_char *p = (const u_char *)vp;
 1634|    798|	char b[3], *r;
 1635|    798|	size_t i, hl;
 1636|       |
 1637|    798|	if (l > 65536)
  ------------------
  |  Branch (1637:6): [True: 0, False: 798]
  ------------------
 1638|      0|		return xstrdup("tohex: length > 65536");
 1639|       |
 1640|    798|	hl = l * 2 + 1;
 1641|    798|	r = xcalloc(1, hl);
 1642|  16.7k|	for (i = 0; i < l; i++) {
  ------------------
  |  Branch (1642:14): [True: 15.9k, False: 798]
  ------------------
 1643|  15.9k|		snprintf(b, sizeof(b), "%02x", p[i]);
 1644|  15.9k|		strlcat(r, b, hl);
 1645|  15.9k|	}
 1646|    798|	return (r);
 1647|    798|}
lowercase:
 2008|    444|{
 2009|  4.13k|	for (; *s; s++)
  ------------------
  |  Branch (2009:9): [True: 3.69k, False: 444]
  ------------------
 2010|  3.69k|		*s = tolower((u_char)*s);
  ------------------
  |  Branch (2010:8): [True: 0, False: 0]
  |  Branch (2010:8): [True: 0, False: 0]
  |  Branch (2010:8): [Folded, False: 3.69k]
  ------------------
 2011|    444|}
argv_split:
 2144|    424|{
 2145|    424|	int r = SSH_ERR_INTERNAL_ERROR;
  ------------------
  |  |   25|    424|#define SSH_ERR_INTERNAL_ERROR			-1
  ------------------
 2146|    424|	int argc = 0, quote, i, j;
 2147|    424|	char *arg, **argv = xcalloc(1, sizeof(*argv));
 2148|       |
 2149|    424|	*argvp = NULL;
 2150|    424|	*argcp = 0;
 2151|       |
 2152|  8.98k|	for (i = 0; s[i] != '\0'; i++) {
  ------------------
  |  Branch (2152:14): [True: 8.98k, False: 0]
  ------------------
 2153|       |		/* Skip leading whitespace */
 2154|  8.98k|		if (s[i] == ' ' || s[i] == '\t')
  ------------------
  |  Branch (2154:7): [True: 85, False: 8.89k]
  |  Branch (2154:22): [True: 3.58k, False: 5.31k]
  ------------------
 2155|  3.66k|			continue;
 2156|  5.31k|		if (terminate_on_comment && s[i] == '#')
  ------------------
  |  Branch (2156:7): [True: 5.31k, False: 0]
  |  Branch (2156:31): [True: 0, False: 5.31k]
  ------------------
 2157|      0|			break;
 2158|       |		/* Start of a token */
 2159|  5.31k|		quote = 0;
 2160|       |
 2161|  5.31k|		argv = xreallocarray(argv, (argc + 2), sizeof(*argv));
 2162|  5.31k|		arg = argv[argc++] = xcalloc(1, strlen(s + i) + 1);
 2163|  5.31k|		argv[argc] = NULL;
 2164|       |
 2165|       |		/* Copy the token in, removing escapes */
 2166|  54.7k|		for (j = 0; s[i] != '\0'; i++) {
  ------------------
  |  Branch (2166:15): [True: 54.3k, False: 424]
  ------------------
 2167|  54.3k|			if (s[i] == '\\') {
  ------------------
  |  Branch (2167:8): [True: 627, False: 53.7k]
  ------------------
 2168|    627|				if (s[i + 1] == '\'' ||
  ------------------
  |  Branch (2168:9): [True: 0, False: 627]
  ------------------
 2169|    627|				    s[i + 1] == '\"' ||
  ------------------
  |  Branch (2169:9): [True: 0, False: 627]
  ------------------
 2170|    627|				    s[i + 1] == '\\' ||
  ------------------
  |  Branch (2170:9): [True: 514, False: 113]
  ------------------
 2171|    514|				    (quote == 0 && s[i + 1] == ' ')) {
  ------------------
  |  Branch (2171:10): [True: 59, False: 54]
  |  Branch (2171:24): [True: 0, False: 59]
  ------------------
 2172|    514|					i++; /* Skip '\' */
 2173|    514|					arg[j++] = s[i];
 2174|    514|				} else {
 2175|       |					/* Unrecognised escape */
 2176|    113|					arg[j++] = s[i];
 2177|    113|				}
 2178|  53.7k|			} else if (quote == 0 && (s[i] == ' ' || s[i] == '\t'))
  ------------------
  |  Branch (2178:15): [True: 51.1k, False: 2.56k]
  |  Branch (2178:30): [True: 33, False: 51.1k]
  |  Branch (2178:45): [True: 4.85k, False: 46.2k]
  ------------------
 2179|  4.89k|				break; /* done */
 2180|  48.8k|			else if (quote == 0 && (s[i] == '\"' || s[i] == '\''))
  ------------------
  |  Branch (2180:13): [True: 46.2k, False: 2.56k]
  |  Branch (2180:28): [True: 27, False: 46.2k]
  |  Branch (2180:44): [True: 64, False: 46.1k]
  ------------------
 2181|     91|				quote = s[i]; /* quote start */
 2182|  48.7k|			else if (quote != 0 && s[i] == quote)
  ------------------
  |  Branch (2182:13): [True: 2.56k, False: 46.1k]
  |  Branch (2182:27): [True: 91, False: 2.47k]
  ------------------
 2183|     91|				quote = 0; /* quote end */
 2184|  48.6k|			else
 2185|  48.6k|				arg[j++] = s[i];
 2186|  54.3k|		}
 2187|  5.31k|		if (s[i] == '\0') {
  ------------------
  |  Branch (2187:7): [True: 424, False: 4.89k]
  ------------------
 2188|    424|			if (quote != 0) {
  ------------------
  |  Branch (2188:8): [True: 0, False: 424]
  ------------------
 2189|       |				/* Ran out of string looking for close quote */
 2190|      0|				r = SSH_ERR_INVALID_FORMAT;
  ------------------
  |  |   28|      0|#define SSH_ERR_INVALID_FORMAT			-4
  ------------------
 2191|      0|				goto out;
 2192|      0|			}
 2193|    424|			break;
 2194|    424|		}
 2195|  5.31k|	}
 2196|       |	/* Success */
 2197|    424|	*argcp = argc;
 2198|    424|	*argvp = argv;
 2199|    424|	argc = 0;
 2200|    424|	argv = NULL;
 2201|    424|	r = 0;
 2202|    424| out:
 2203|    424|	if (argc != 0 && argv != NULL) {
  ------------------
  |  Branch (2203:6): [True: 0, False: 424]
  |  Branch (2203:19): [True: 0, False: 0]
  ------------------
 2204|      0|		for (i = 0; i < argc; i++)
  ------------------
  |  Branch (2204:15): [True: 0, False: 0]
  ------------------
 2205|      0|			free(argv[i]);
 2206|      0|		free(argv);
 2207|      0|	}
 2208|    424|	return r;
 2209|    424|}
argv_next:
 2267|  5.50k|{
 2268|  5.50k|	char *ret = (*argvp)[0];
 2269|       |
 2270|  5.50k|	if (*argcp > 0 && ret != NULL) {
  ------------------
  |  Branch (2270:6): [True: 5.23k, False: 271]
  |  Branch (2270:20): [True: 5.23k, False: 0]
  ------------------
 2271|  5.23k|		(*argcp)--;
 2272|  5.23k|		(*argvp)++;
 2273|  5.23k|	}
 2274|  5.50k|	return ret;
 2275|  5.50k|}
argv_consume:
 2279|     26|{
 2280|     26|	*argcp = 0;
 2281|     26|}
argv_free:
 2285|    424|{
 2286|    424|	int i;
 2287|       |
 2288|    424|	if (av == NULL)
  ------------------
  |  Branch (2288:6): [True: 0, False: 424]
  ------------------
 2289|      0|		return;
 2290|  5.74k|	for (i = 0; i < ac; i++)
  ------------------
  |  Branch (2290:14): [True: 5.31k, False: 424]
  ------------------
 2291|  5.31k|		free(av[i]);
 2292|    424|	free(av);
 2293|    424|}
parse_pattern_interval:
 2637|      1|{
 2638|      1|	char *cp, *sdup;
 2639|      1|	double secs;
 2640|       |
 2641|      1|	if (typep != NULL)
  ------------------
  |  Branch (2641:6): [True: 0, False: 1]
  ------------------
 2642|      0|		*typep = NULL;
 2643|      1|	if (secsp != NULL)
  ------------------
  |  Branch (2643:6): [True: 0, False: 1]
  ------------------
 2644|      0|		*secsp = 0;
 2645|      1|	if (s == NULL)
  ------------------
  |  Branch (2645:6): [True: 0, False: 1]
  ------------------
 2646|      0|		return -1;
 2647|      1|	sdup = xstrdup(s);
 2648|       |
 2649|      1|	if ((cp = strchr(sdup, '=')) == NULL || cp == sdup) {
  ------------------
  |  Branch (2649:6): [True: 0, False: 1]
  |  Branch (2649:42): [True: 0, False: 1]
  ------------------
 2650|      0|		free(sdup);
 2651|      0|		return -1;
 2652|      0|	}
 2653|      1|	*cp++ = '\0';
 2654|      1|	if ((secs = convtime_double(cp)) < 0.0) {
  ------------------
  |  Branch (2654:6): [True: 0, False: 1]
  ------------------
 2655|      0|		free(sdup);
 2656|      0|		return -1;
 2657|      0|	}
 2658|       |	/* success */
 2659|      1|	if (typep != NULL)
  ------------------
  |  Branch (2659:6): [True: 0, False: 1]
  ------------------
 2660|      0|		*typep = xstrdup(sdup);
 2661|      1|	if (secsp != NULL)
  ------------------
  |  Branch (2661:6): [True: 0, False: 1]
  ------------------
 2662|      0|		*secsp = secs;
 2663|      1|	free(sdup);
 2664|      1|	return 0;
 2665|      1|}
path_absolute:
 2670|    792|{
 2671|    792|	return (*path == '/') ? 1 : 0;
  ------------------
  |  Branch (2671:9): [True: 54, False: 738]
  ------------------
 2672|    792|}
opt_array_append2:
 2758|  1.08k|{
 2759|       |
 2760|  1.08k|	if (*lp >= INT_MAX)
  ------------------
  |  Branch (2760:6): [True: 0, False: 1.08k]
  ------------------
 2761|      0|		fatal("%s line %d: Too many %s entries", file, line, directive);
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2762|       |
 2763|  1.08k|	if (iarray != NULL) {
  ------------------
  |  Branch (2763:6): [True: 0, False: 1.08k]
  ------------------
 2764|      0|		*iarray = xrecallocarray(*iarray, *lp, *lp + 1,
 2765|      0|		    sizeof(**iarray));
 2766|      0|		(*iarray)[*lp] = i;
 2767|      0|	}
 2768|       |
 2769|  1.08k|	*array = xrecallocarray(*array, *lp, *lp + 1, sizeof(**array));
 2770|  1.08k|	(*array)[*lp] = xstrdup(s);
 2771|  1.08k|	(*lp)++;
 2772|  1.08k|}
opt_array_append:
 2777|  1.08k|{
 2778|       |	opt_array_append2(file, line, directive, array, NULL, lp, s, 0);
 2779|  1.08k|}
opt_array_free2:
 2783|    424|{
 2784|    424|	u_int i;
 2785|       |
 2786|    424|	if (array == NULL || l == 0)
  ------------------
  |  Branch (2786:6): [True: 419, False: 5]
  |  Branch (2786:23): [True: 0, False: 5]
  ------------------
 2787|    419|		return;
 2788|     11|	for (i = 0; i < l; i++)
  ------------------
  |  Branch (2788:14): [True: 6, False: 5]
  ------------------
 2789|      6|		free(array[i]);
 2790|      5|	free(array);
 2791|      5|	free(iarray);
 2792|      5|}
lookup_env_in_list:
 3012|    520|{
 3013|    520|	size_t i, envlen;
 3014|       |
 3015|    520|	envlen = strlen(env);
 3016|  3.43k|	for (i = 0; i < nenvs; i++) {
  ------------------
  |  Branch (3016:14): [True: 3.25k, False: 184]
  ------------------
 3017|  3.25k|		if (strncmp(envs[i], env, envlen) == 0 &&
  ------------------
  |  Branch (3017:7): [True: 1.11k, False: 2.13k]
  ------------------
 3018|  1.11k|		    envs[i][envlen] == '=') {
  ------------------
  |  Branch (3018:7): [True: 336, False: 783]
  ------------------
 3019|    336|			return envs[i] + envlen + 1;
 3020|    336|		}
 3021|  3.25k|	}
 3022|    184|	return NULL;
 3023|    520|}
lookup_setenv_in_list:
 3027|    520|{
 3028|    520|	char *name, *cp;
 3029|    520|	const char *ret;
 3030|       |
 3031|    520|	name = xstrdup(env);
 3032|    520|	if ((cp = strchr(name, '=')) == NULL) {
  ------------------
  |  Branch (3032:6): [True: 0, False: 520]
  ------------------
 3033|      0|		free(name);
 3034|      0|		return NULL; /* not env=val */
 3035|      0|	}
 3036|    520|	*cp = '\0';
 3037|    520|	ret = lookup_env_in_list(name, envs, nenvs);
 3038|    520|	free(name);
 3039|    520|	return ret;
 3040|    520|}
misc.c:strdelim_internal:
  483|  2.25k|{
  484|  2.25k|	char *old;
  485|  2.25k|	int wspace = 0;
  486|       |
  487|  2.25k|	if (*s == NULL)
  ------------------
  |  Branch (487:6): [True: 0, False: 2.25k]
  ------------------
  488|      0|		return NULL;
  489|       |
  490|  2.25k|	old = *s;
  491|       |
  492|  2.25k|	*s = strpbrk(*s,
  493|  2.25k|	    split_equals ? WHITESPACE QUOTE "=" : WHITESPACE QUOTE);
  ------------------
  |  |  477|  2.25k|#define WHITESPACE " \t\r\n"
  ------------------
              	    split_equals ? WHITESPACE QUOTE "=" : WHITESPACE QUOTE);
  ------------------
  |  |  477|      0|#define WHITESPACE " \t\r\n"
  ------------------
              	    split_equals ? WHITESPACE QUOTE "=" : WHITESPACE QUOTE);
  ------------------
  |  |  478|  2.25k|#define QUOTE	"\""
  ------------------
  |  Branch (493:6): [True: 2.25k, False: 0]
  ------------------
  494|  2.25k|	if (*s == NULL)
  ------------------
  |  Branch (494:6): [True: 749, False: 1.50k]
  ------------------
  495|    749|		return (old);
  496|       |
  497|  1.50k|	if (*s[0] == '\"') {
  ------------------
  |  Branch (497:6): [True: 88, False: 1.41k]
  ------------------
  498|     88|		memmove(*s, *s + 1, strlen(*s)); /* move nul too */
  499|       |		/* Find matching quote */
  500|     88|		if ((*s = strpbrk(*s, QUOTE)) == NULL) {
  ------------------
  |  |  478|     88|#define QUOTE	"\""
  ------------------
  |  Branch (500:7): [True: 87, False: 1]
  ------------------
  501|     87|			return (NULL);		/* no matching quote */
  502|     87|		} else {
  503|      1|			*s[0] = '\0';
  504|      1|			*s += strspn(*s + 1, WHITESPACE) + 1;
  ------------------
  |  |  477|      1|#define WHITESPACE " \t\r\n"
  ------------------
  505|      1|			return (old);
  506|      1|		}
  507|     88|	}
  508|       |
  509|       |	/* Allow only one '=' to be skipped */
  510|  1.41k|	if (split_equals && *s[0] == '=')
  ------------------
  |  Branch (510:6): [True: 1.41k, False: 0]
  |  Branch (510:22): [True: 69, False: 1.35k]
  ------------------
  511|     69|		wspace = 1;
  512|  1.41k|	*s[0] = '\0';
  513|       |
  514|       |	/* Skip any extra whitespace after first token */
  515|  1.41k|	*s += strspn(*s + 1, WHITESPACE) + 1;
  ------------------
  |  |  477|  1.41k|#define WHITESPACE " \t\r\n"
  ------------------
  516|  1.41k|	if (split_equals && *s[0] == '=' && !wspace)
  ------------------
  |  Branch (516:6): [True: 1.41k, False: 0]
  |  Branch (516:22): [True: 57, False: 1.36k]
  |  Branch (516:38): [True: 2, False: 55]
  ------------------
  517|      2|		*s += strspn(*s + 1, WHITESPACE) + 1;
  ------------------
  |  |  477|      2|#define WHITESPACE " \t\r\n"
  ------------------
  518|       |
  519|  1.41k|	return (old);
  520|  1.50k|}
misc.c:vdollar_percent_expand:
 1363|    802|{
 1364|    802|#define EXPAND_MAX_KEYS	64
 1365|    802|	u_int num_keys = 0, i;
 1366|    802|	struct {
 1367|    802|		const char *key;
 1368|    802|		const char *repl;
 1369|    802|	} keys[EXPAND_MAX_KEYS];
 1370|    802|	struct sshbuf *buf;
 1371|    802|	int r, missingvar = 0;
 1372|    802|	char *ret = NULL, *var, *varend, *val;
 1373|    802|	size_t len;
 1374|       |
 1375|    802|	if ((buf = sshbuf_new()) == NULL)
  ------------------
  |  Branch (1375:6): [True: 0, False: 802]
  ------------------
 1376|      0|		fatal_f("sshbuf_new failed");
  ------------------
  |  |  126|      0|#define fatal_f(...)		sshfatal(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 1377|    802|	if (parseerror == NULL)
  ------------------
  |  Branch (1377:6): [True: 0, False: 802]
  ------------------
 1378|      0|		fatal_f("null parseerror arg");
  ------------------
  |  |  126|      0|#define fatal_f(...)		sshfatal(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 1379|    802|	*parseerror = 1;
 1380|       |
 1381|       |	/* Gather keys if we're doing percent expansion. */
 1382|    802|	if (percent) {
  ------------------
  |  Branch (1382:6): [True: 798, False: 4]
  ------------------
 1383|  10.3k|		for (num_keys = 0; num_keys < EXPAND_MAX_KEYS; num_keys++) {
  ------------------
  |  | 1364|  10.3k|#define EXPAND_MAX_KEYS	64
  ------------------
  |  Branch (1383:22): [True: 10.3k, False: 0]
  ------------------
 1384|  10.3k|			keys[num_keys].key = va_arg(ap, char *);
 1385|  10.3k|			if (keys[num_keys].key == NULL)
  ------------------
  |  Branch (1385:8): [True: 798, False: 9.57k]
  ------------------
 1386|    798|				break;
 1387|  9.57k|			keys[num_keys].repl = va_arg(ap, char *);
 1388|  9.57k|			if (keys[num_keys].repl == NULL) {
  ------------------
  |  Branch (1388:8): [True: 0, False: 9.57k]
  ------------------
 1389|      0|				fatal_f("NULL replacement for token %s",
  ------------------
  |  |  126|      0|#define fatal_f(...)		sshfatal(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 1390|      0|				    keys[num_keys].key);
 1391|      0|			}
 1392|  9.57k|		}
 1393|    798|		if (num_keys == EXPAND_MAX_KEYS && va_arg(ap, char *) != NULL)
  ------------------
  |  | 1364|  1.59k|#define EXPAND_MAX_KEYS	64
  ------------------
  |  Branch (1393:7): [True: 0, False: 798]
  |  Branch (1393:38): [True: 0, False: 0]
  ------------------
 1394|      0|			fatal_f("too many keys");
  ------------------
  |  |  126|      0|#define fatal_f(...)		sshfatal(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 1395|    798|		if (num_keys == 0)
  ------------------
  |  Branch (1395:7): [True: 0, False: 798]
  ------------------
 1396|      0|			fatal_f("percent expansion without token list");
  ------------------
  |  |  126|      0|#define fatal_f(...)		sshfatal(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 1397|    798|	}
 1398|       |
 1399|       |	/* Expand string */
 1400|  13.1k|	for (i = 0; *string != '\0'; string++) {
  ------------------
  |  Branch (1400:14): [True: 12.3k, False: 802]
  ------------------
 1401|       |		/* Optionally process ${ENVIRONMENT} expansions. */
 1402|  12.3k|		if (dollar && string[0] == '$' && string[1] == '{') {
  ------------------
  |  Branch (1402:7): [True: 12.3k, False: 0]
  |  Branch (1402:17): [True: 178, False: 12.1k]
  |  Branch (1402:37): [True: 6, False: 172]
  ------------------
 1403|      6|			string += 2;  /* skip over '${' */
 1404|      6|			if ((varend = strchr(string, '}')) == NULL) {
  ------------------
  |  Branch (1404:8): [True: 0, False: 6]
  ------------------
 1405|      0|				error_f("environment variable '%s' missing "
  ------------------
  |  |  125|      0|#define error_f(...)		sshlog(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1406|      0|				    "closing '}'", string);
 1407|      0|				goto out;
 1408|      0|			}
 1409|      6|			len = varend - string;
 1410|      6|			if (len == 0) {
  ------------------
  |  Branch (1410:8): [True: 0, False: 6]
  ------------------
 1411|      0|				error_f("zero-length environment variable");
  ------------------
  |  |  125|      0|#define error_f(...)		sshlog(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1412|      0|				goto out;
 1413|      0|			}
 1414|      6|			var = xmalloc(len + 1);
 1415|      6|			(void)strlcpy(var, string, len + 1);
 1416|      6|			if ((val = getenv(var)) == NULL) {
  ------------------
  |  Branch (1416:8): [True: 6, False: 0]
  ------------------
 1417|      6|				error_f("env var ${%s} has no value", var);
  ------------------
  |  |  125|      6|#define error_f(...)		sshlog(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1418|      6|				missingvar = 1;
 1419|      6|			} else {
 1420|      0|				debug3_f("expand ${%s} -> '%s'", var, val);
  ------------------
  |  |  120|      0|#define debug3_f(...)		sshlog(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_DEBUG3, NULL, __VA_ARGS__)
  ------------------
 1421|      0|				if ((r = sshbuf_put(buf, val, strlen(val))) !=0)
  ------------------
  |  Branch (1421:9): [True: 0, False: 0]
  ------------------
 1422|      0|					fatal_fr(r, "sshbuf_put ${}");
  ------------------
  |  |  146|      0|#define fatal_fr(r, ...)	sshfatal(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), __VA_ARGS__)
  ------------------
 1423|      0|			}
 1424|      6|			free(var);
 1425|      6|			string += len;
 1426|      6|			continue;
 1427|      6|		}
 1428|       |
 1429|       |		/*
 1430|       |		 * Process percent expansions if we have a list of TOKENs.
 1431|       |		 * If we're not doing percent expansion everything just gets
 1432|       |		 * appended here.
 1433|       |		 */
 1434|  12.3k|		if (*string != '%' || !percent) {
  ------------------
  |  Branch (1434:7): [True: 12.1k, False: 192]
  |  Branch (1434:25): [True: 0, False: 192]
  ------------------
 1435|  12.2k| append:
 1436|  12.2k|			if ((r = sshbuf_put_u8(buf, *string)) != 0)
  ------------------
  |  Branch (1436:8): [True: 0, False: 12.2k]
  ------------------
 1437|      0|				fatal_fr(r, "sshbuf_put_u8 %%");
  ------------------
  |  |  146|      0|#define fatal_fr(r, ...)	sshfatal(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), __VA_ARGS__)
  ------------------
 1438|  12.2k|			continue;
 1439|  12.2k|		}
 1440|    192|		string++;
 1441|       |		/* %% case */
 1442|    192|		if (*string == '%')
  ------------------
  |  Branch (1442:7): [True: 58, False: 134]
  ------------------
 1443|     58|			goto append;
 1444|    134|		if (*string == '\0') {
  ------------------
  |  Branch (1444:7): [True: 0, False: 134]
  ------------------
 1445|      0|			error_f("invalid format");
  ------------------
  |  |  125|      0|#define error_f(...)		sshlog(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1446|      0|			goto out;
 1447|      0|		}
 1448|  1.03k|		for (i = 0; i < num_keys; i++) {
  ------------------
  |  Branch (1448:15): [True: 1.03k, False: 0]
  ------------------
 1449|  1.03k|			if (strchr(keys[i].key, *string) != NULL) {
  ------------------
  |  Branch (1449:8): [True: 134, False: 898]
  ------------------
 1450|    134|				if ((r = sshbuf_put(buf, keys[i].repl,
  ------------------
  |  Branch (1450:9): [True: 0, False: 134]
  ------------------
 1451|    134|				    strlen(keys[i].repl))) != 0)
 1452|      0|					fatal_fr(r, "sshbuf_put %%-repl");
  ------------------
  |  |  146|      0|#define fatal_fr(r, ...)	sshfatal(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), __VA_ARGS__)
  ------------------
 1453|    134|				break;
 1454|    134|			}
 1455|  1.03k|		}
 1456|    134|		if (i >= num_keys) {
  ------------------
  |  Branch (1456:7): [True: 0, False: 134]
  ------------------
 1457|      0|			error_f("unknown key %%%c", *string);
  ------------------
  |  |  125|      0|#define error_f(...)		sshlog(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1458|      0|			goto out;
 1459|      0|		}
 1460|    134|	}
 1461|    802|	if (!missingvar && (ret = sshbuf_dup_string(buf)) == NULL)
  ------------------
  |  Branch (1461:6): [True: 796, False: 6]
  |  Branch (1461:21): [True: 0, False: 796]
  ------------------
 1462|      0|		fatal_f("sshbuf_dup_string failed");
  ------------------
  |  |  126|      0|#define fatal_f(...)		sshfatal(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 1463|    802|	*parseerror = 0;
 1464|    802| out:
 1465|    802|	sshbuf_free(buf);
 1466|    802|	return *parseerror ? NULL : ret;
  ------------------
  |  Branch (1466:9): [True: 0, False: 802]
  ------------------
 1467|    802|#undef EXPAND_MAX_KEYS
 1468|    802|}

scan_scaled:
   77|     35|{
   78|     35|	char *p = scaled;
   79|     35|	int sign = 0;
   80|     35|	unsigned int i, ndigits = 0, fract_digits = 0, muls = 0, divs = 0;
   81|     35|	long long scale_fact = 1, whole = 0, fpart = 0;
   82|       |
   83|       |	/* Skip leading whitespace */
   84|    159|	while (isascii((unsigned char)*p) && isspace((unsigned char)*p))
  ------------------
  |  Branch (84:9): [True: 159, False: 0]
  |  Branch (84:39): [True: 124, False: 35]
  ------------------
   85|    124|		++p;
   86|       |
   87|       |	/* Then at most one leading + or - */
   88|     37|	while (*p == '-' || *p == '+') {
  ------------------
  |  Branch (88:9): [True: 1, False: 36]
  |  Branch (88:22): [True: 1, False: 35]
  ------------------
   89|      2|		if (*p == '-') {
  ------------------
  |  Branch (89:7): [True: 1, False: 1]
  ------------------
   90|      1|			if (sign) {
  ------------------
  |  Branch (90:8): [True: 0, False: 1]
  ------------------
   91|      0|				errno = EINVAL;
   92|      0|				return -1;
   93|      0|			}
   94|      1|			sign = -1;
   95|      1|			++p;
   96|      1|		} else if (*p == '+') {
  ------------------
  |  Branch (96:14): [True: 1, False: 0]
  ------------------
   97|      1|			if (sign) {
  ------------------
  |  Branch (97:8): [True: 0, False: 1]
  ------------------
   98|      0|				errno = EINVAL;
   99|      0|				return -1;
  100|      0|			}
  101|      1|			sign = +1;
  102|      1|			++p;
  103|      1|		}
  104|      2|	}
  105|       |
  106|       |	/* Main loop: Scan digits, find decimal point, if present.
  107|       |	 * We don't allow exponentials, so no scientific notation
  108|       |	 * (but note that E for Exa might look like e to some!).
  109|       |	 * Advance 'p' to end, to get scale factor.
  110|       |	 */
  111|    305|	for (; isascii((unsigned char)*p) &&
  ------------------
  |  Branch (111:9): [True: 305, False: 0]
  ------------------
  112|    305|	    (isdigit((unsigned char)*p) || *p=='.'); ++p) {
  ------------------
  |  Branch (112:7): [True: 242, False: 63]
  |  Branch (112:37): [True: 28, False: 35]
  ------------------
  113|    270|		if (*p == '.') {
  ------------------
  |  Branch (113:7): [True: 28, False: 242]
  ------------------
  114|     28|			if (fract_digits > 0) {	/* oops, more than one '.' */
  ------------------
  |  Branch (114:8): [True: 0, False: 28]
  ------------------
  115|      0|				errno = EINVAL;
  116|      0|				return -1;
  117|      0|			}
  118|     28|			fract_digits = 1;
  119|     28|			continue;
  120|     28|		}
  121|       |
  122|    242|		i = (*p) - '0';			/* whew! finally a digit we can use */
  123|    242|		if (fract_digits > 0) {
  ------------------
  |  Branch (123:7): [True: 232, False: 10]
  ------------------
  124|    232|			if (fract_digits >= MAX_DIGITS-1)
  ------------------
  |  |   70|    232|#define MAX_DIGITS (SCALE_LENGTH * 3)	/* XXX strlen(sprintf("%lld", -1)? */
  |  |  ------------------
  |  |  |  |   68|    232|#define	SCALE_LENGTH (sizeof(units)/sizeof(units[0]))
  |  |  ------------------
  ------------------
  |  Branch (124:8): [True: 71, False: 161]
  ------------------
  125|       |				/* ignore extra fractional digits */
  126|     71|				continue;
  127|    161|			fract_digits++;		/* for later scaling */
  128|    161|			if (fpart > LLONG_MAX / 10) {
  ------------------
  |  Branch (128:8): [True: 0, False: 161]
  ------------------
  129|      0|				errno = ERANGE;
  130|      0|				return -1;
  131|      0|			}
  132|    161|			fpart *= 10;
  133|    161|			if (i > LLONG_MAX - fpart) {
  ------------------
  |  Branch (133:8): [True: 0, False: 161]
  ------------------
  134|      0|				errno = ERANGE;
  135|      0|				return -1;
  136|      0|			}
  137|    161|			fpart += i;
  138|    161|		} else {				/* normal digit */
  139|     10|			if (++ndigits >= MAX_DIGITS) {
  ------------------
  |  |   70|     10|#define MAX_DIGITS (SCALE_LENGTH * 3)	/* XXX strlen(sprintf("%lld", -1)? */
  |  |  ------------------
  |  |  |  |   68|     10|#define	SCALE_LENGTH (sizeof(units)/sizeof(units[0]))
  |  |  ------------------
  ------------------
  |  Branch (139:8): [True: 0, False: 10]
  ------------------
  140|      0|				errno = ERANGE;
  141|      0|				return -1;
  142|      0|			}
  143|     10|			if (whole > LLONG_MAX / 10) {
  ------------------
  |  Branch (143:8): [True: 0, False: 10]
  ------------------
  144|      0|				errno = ERANGE;
  145|      0|				return -1;
  146|      0|			}
  147|     10|			whole *= 10;
  148|     10|			if (i > LLONG_MAX - whole) {
  ------------------
  |  Branch (148:8): [True: 0, False: 10]
  ------------------
  149|      0|				errno = ERANGE;
  150|      0|				return -1;
  151|      0|			}
  152|     10|			whole += i;
  153|     10|		}
  154|    242|	}
  155|       |
  156|     35|	if (sign)
  ------------------
  |  Branch (156:6): [True: 2, False: 33]
  ------------------
  157|      2|		whole *= sign;
  158|       |
  159|       |	/* If no scale factor given, we're done. fraction is discarded. */
  160|     35|	if (!*p) {
  ------------------
  |  Branch (160:6): [True: 3, False: 32]
  ------------------
  161|      3|		*result = whole;
  162|      3|		return 0;
  163|      3|	}
  164|       |
  165|       |	/* Validate scale factor, and scale whole and fraction by it. */
  166|    120|	for (i = 0; i < SCALE_LENGTH; i++) {
  ------------------
  |  |   68|    120|#define	SCALE_LENGTH (sizeof(units)/sizeof(units[0]))
  ------------------
  |  Branch (166:14): [True: 120, False: 0]
  ------------------
  167|       |
  168|       |		/* Are we there yet? */
  169|    120|		if (*p == scale_chars[i] ||
  ------------------
  |  Branch (169:7): [True: 5, False: 115]
  ------------------
  170|    115|			*p == tolower((unsigned char)scale_chars[i])) {
  ------------------
  |  Branch (170:4): [True: 27, False: 88]
  |  Branch (170:10): [True: 0, False: 0]
  |  Branch (170:10): [True: 0, False: 0]
  |  Branch (170:10): [Folded, False: 115]
  ------------------
  171|       |
  172|       |			/* If it ends with alphanumerics after the scale char, bad. */
  173|     32|			if (isalnum((unsigned char)*(p+1))) {
  ------------------
  |  Branch (173:8): [True: 0, False: 32]
  ------------------
  174|      0|				errno = EINVAL;
  175|      0|				return -1;
  176|      0|			}
  177|     32|			scale_fact = scale_factors[i];
  178|       |
  179|       |			/* check for overflow and underflow after scaling */
  180|     32|			if (whole > LLONG_MAX / scale_fact ||
  ------------------
  |  Branch (180:8): [True: 0, False: 32]
  ------------------
  181|     32|			    whole < LLONG_MIN / scale_fact) {
  ------------------
  |  Branch (181:8): [True: 0, False: 32]
  ------------------
  182|      0|				errno = ERANGE;
  183|      0|				return -1;
  184|      0|			}
  185|       |
  186|       |			/* scale whole part */
  187|     32|			whole *= scale_fact;
  188|       |
  189|       |			/*
  190|       |			 * Scale fractional part: compute
  191|       |			 *   fpart * scale_fact / 10^(fract_digits-1)
  192|       |			 * without intermediate overflow. scale_fact is 1024^i,
  193|       |			 * i.e. a power of 1024 = 2^10. Interleave
  194|       |			 * multiply-by-1024 with divide-by-10 so the running
  195|       |			 * value stays within long long range while preserving
  196|       |			 * precision.
  197|       |			 */
  198|     32|			muls = i;
  199|     32|			divs = fract_digits > 0 ?  fract_digits - 1 : 0;
  ------------------
  |  Branch (199:11): [True: 26, False: 6]
  ------------------
  200|    137|			while (muls > 0 && divs > 0) {
  ------------------
  |  Branch (200:11): [True: 112, False: 25]
  |  Branch (200:23): [True: 105, False: 7]
  ------------------
  201|    105|				if (fpart <= LLONG_MAX / 1024) {
  ------------------
  |  Branch (201:9): [True: 64, False: 41]
  ------------------
  202|     64|					fpart *= 1024;
  203|     64|					muls--;
  204|     64|				} else {
  205|     41|					fpart /= 10;
  206|     41|					divs--;
  207|     41|				}
  208|    105|			}
  209|     56|			while (muls > 0) {
  ------------------
  |  Branch (209:11): [True: 24, False: 32]
  ------------------
  210|     24|				fpart *= 1024;
  211|     24|				muls--;
  212|     24|			}
  213|    147|			while (divs > 0) {
  ------------------
  |  Branch (213:11): [True: 115, False: 32]
  ------------------
  214|    115|				fpart /= 10;
  215|    115|				divs--;
  216|    115|			}
  217|     32|			if (sign == -1)
  ------------------
  |  Branch (217:8): [True: 1, False: 31]
  ------------------
  218|      1|				whole -= fpart;
  219|     31|			else
  220|     31|				whole += fpart;
  221|     32|			*result = whole;
  222|     32|			return 0;
  223|     32|		}
  224|    120|	}
  225|       |
  226|       |	/* Invalid unit or character */
  227|     32|	errno = EINVAL;
  228|      0|	return -1;
  229|     32|}

freezero:
   26|  2.40k|{
   27|  2.40k|	if (ptr == NULL)
  ------------------
  |  Branch (27:6): [True: 0, False: 2.40k]
  ------------------
   28|      0|		return;
   29|  2.40k|	explicit_bzero(ptr, sz);
   30|  2.40k|	free(ptr);
   31|  2.40k|}

_ssh__compat_glob:
  182|    792|{
  183|    792|	const u_char *patnext;
  184|    792|	int c;
  185|    792|	Char *bufnext, *bufend, patbuf[PATH_MAX];
  186|    792|	struct glob_lim limit = { 0, 0, 0 };
  187|       |
  188|    792|	patnext = (u_char *) pattern;
  189|    792|	if (!(flags & GLOB_APPEND)) {
  ------------------
  |  |   78|    792|#define	GLOB_APPEND	0x0001	/* Append to output from previous call. */
  ------------------
  |  Branch (189:6): [True: 792, False: 0]
  ------------------
  190|    792|		pglob->gl_pathc = 0;
  191|    792|		pglob->gl_pathv = NULL;
  192|    792|		pglob->gl_statv = NULL;
  193|    792|		if (!(flags & GLOB_DOOFFS))
  ------------------
  |  |   79|    792|#define	GLOB_DOOFFS	0x0002	/* Use gl_offs. */
  ------------------
  |  Branch (193:7): [True: 792, False: 0]
  ------------------
  194|    792|			pglob->gl_offs = 0;
  195|    792|	}
  196|    792|	pglob->gl_flags = flags & ~GLOB_MAGCHAR;
  ------------------
  |  |   93|    792|#define	GLOB_MAGCHAR	0x0100	/* Pattern had globbing characters. */
  ------------------
  197|    792|	pglob->gl_errfunc = errfunc;
  198|    792|	pglob->gl_matchc = 0;
  199|       |
  200|    792|	if (strnlen(pattern, PATH_MAX) == PATH_MAX)
  ------------------
  |  Branch (200:6): [True: 0, False: 792]
  ------------------
  201|      0|		return(GLOB_NOMATCH);
  ------------------
  |  |   88|      0|#define	GLOB_NOMATCH	(-3)	/* No match and GLOB_NOCHECK not set. */
  ------------------
  202|       |
  203|    792|	if (pglob->gl_offs >= SSIZE_MAX || pglob->gl_pathc >= SSIZE_MAX ||
  ------------------
  |  Branch (203:6): [True: 0, False: 792]
  |  Branch (203:37): [True: 0, False: 792]
  ------------------
  204|    792|	    pglob->gl_pathc >= SSIZE_MAX - pglob->gl_offs - 1)
  ------------------
  |  Branch (204:6): [True: 0, False: 792]
  ------------------
  205|      0|		return GLOB_NOSPACE;
  ------------------
  |  |   86|      0|#define	GLOB_NOSPACE	(-1)	/* Malloc call failed. */
  ------------------
  206|       |
  207|    792|	bufnext = patbuf;
  208|    792|	bufend = bufnext + PATH_MAX - 1;
  209|    792|	if (flags & GLOB_NOESCAPE)
  ------------------
  |  |   84|    792|#define	GLOB_NOESCAPE	0x1000	/* Disable backslash escaping. */
  ------------------
  |  Branch (209:6): [True: 0, False: 792]
  ------------------
  210|      0|		while (bufnext < bufend && (c = *patnext++) != EOS)
  ------------------
  |  |   90|      0|#define	EOS		'\0'
  ------------------
  |  Branch (210:10): [True: 0, False: 0]
  |  Branch (210:30): [True: 0, False: 0]
  ------------------
  211|      0|			*bufnext++ = c;
  212|    792|	else {
  213|       |		/* Protect the quoted characters. */
  214|  24.5k|		while (bufnext < bufend && (c = *patnext++) != EOS)
  ------------------
  |  |   90|  24.5k|#define	EOS		'\0'
  ------------------
  |  Branch (214:10): [True: 24.5k, False: 0]
  |  Branch (214:30): [True: 23.7k, False: 792]
  ------------------
  215|  23.7k|			if (c == QUOTE) {
  ------------------
  |  |   94|  23.7k|#define	QUOTE		'\\'
  ------------------
  |  Branch (215:8): [True: 357, False: 23.3k]
  ------------------
  216|    357|				if ((c = *patnext++) == EOS) {
  ------------------
  |  |   90|    357|#define	EOS		'\0'
  ------------------
  |  Branch (216:9): [True: 4, False: 353]
  ------------------
  217|      4|					c = QUOTE;
  ------------------
  |  |   94|      4|#define	QUOTE		'\\'
  ------------------
  218|      4|					--patnext;
  219|      4|				}
  220|    357|				*bufnext++ = c | M_PROTECT;
  ------------------
  |  |  109|    357|#define	M_PROTECT	0x4000
  ------------------
  221|    357|			} else
  222|  23.3k|				*bufnext++ = c;
  223|    792|	}
  224|    792|	*bufnext = EOS;
  ------------------
  |  |   90|    792|#define	EOS		'\0'
  ------------------
  225|       |
  226|    792|	if (flags & GLOB_BRACE)
  ------------------
  |  |   92|    792|#define	GLOB_BRACE	0x0080	/* Expand braces ala csh. */
  ------------------
  |  Branch (226:6): [True: 0, False: 792]
  ------------------
  227|      0|		return globexp1(patbuf, pglob, &limit);
  228|    792|	else
  229|    792|		return glob0(patbuf, pglob, &limit);
  230|    792|}
glob.c:g_strchr:
 1038|    304|{
 1039|  7.38k|	do {
 1040|  7.38k|		if (*str == ch)
  ------------------
  |  Branch (1040:7): [True: 132, False: 7.25k]
  ------------------
 1041|    132|			return ((Char *)str);
 1042|  7.38k|	} while (*str++);
  ------------------
  |  Branch (1042:11): [True: 7.08k, False: 172]
  ------------------
 1043|    172|	return (NULL);
 1044|    304|}
glob.c:glob0:
  474|    792|{
  475|    792|	const Char *qpatnext;
  476|    792|	int c, err;
  477|    792|	size_t oldpathc;
  478|    792|	Char *bufnext, patbuf[PATH_MAX];
  479|       |
  480|    792|	qpatnext = globtilde(pattern, patbuf, PATH_MAX, pglob);
  481|    792|	oldpathc = pglob->gl_pathc;
  482|    792|	bufnext = patbuf;
  483|       |
  484|       |	/* We don't need to check for buffer overflow any more. */
  485|  20.2k|	while ((c = *qpatnext++) != EOS) {
  ------------------
  |  |   90|  20.2k|#define	EOS		'\0'
  ------------------
  |  Branch (485:9): [True: 19.4k, False: 765]
  ------------------
  486|  19.4k|		switch (c) {
  487|    257|		case LBRACKET:
  ------------------
  |  |   91|    257|#define	LBRACKET	'['
  ------------------
  |  Branch (487:3): [True: 257, False: 19.2k]
  ------------------
  488|    257|			c = *qpatnext;
  489|    257|			if (c == NOT)
  ------------------
  |  |   92|    257|#define	NOT		'!'
  ------------------
  |  Branch (489:8): [True: 6, False: 251]
  ------------------
  490|      6|				++qpatnext;
  491|    257|			if (*qpatnext == EOS ||
  ------------------
  |  |   90|    514|#define	EOS		'\0'
  ------------------
  |  Branch (491:8): [True: 19, False: 238]
  ------------------
  492|    238|			    g_strchr(qpatnext+1, RBRACKET) == NULL) {
  ------------------
  |  |   96|    238|#define	RBRACKET	']'
  ------------------
  |  Branch (492:8): [True: 156, False: 82]
  ------------------
  493|    175|				*bufnext++ = LBRACKET;
  ------------------
  |  |   91|    175|#define	LBRACKET	'['
  ------------------
  494|    175|				if (c == NOT)
  ------------------
  |  |   92|    175|#define	NOT		'!'
  ------------------
  |  Branch (494:9): [True: 4, False: 171]
  ------------------
  495|      4|					--qpatnext;
  496|    175|				break;
  497|    175|			}
  498|     82|			*bufnext++ = M_SET;
  ------------------
  |  |  134|     82|#define	M_SET		META('[')
  |  |  ------------------
  |  |  |  |  128|     82|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|     82|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  499|     82|			if (c == NOT)
  ------------------
  |  |   92|     82|#define	NOT		'!'
  ------------------
  |  Branch (499:8): [True: 2, False: 80]
  ------------------
  500|      2|				*bufnext++ = M_NOT;
  ------------------
  |  |  131|      2|#define	M_NOT		META('!')
  |  |  ------------------
  |  |  |  |  128|      2|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      2|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  501|     82|			c = *qpatnext++;
  502|  3.68k|			do {
  503|  3.68k|				if (c == LBRACKET && *qpatnext == ':') {
  ------------------
  |  |   91|  7.36k|#define	LBRACKET	'['
  ------------------
  |  Branch (503:9): [True: 117, False: 3.56k]
  |  Branch (503:26): [True: 66, False: 51]
  ------------------
  504|     66|					do {
  505|     66|						err = g_charclass(&qpatnext,
  506|     66|						    &bufnext);
  507|     66|						if (err)
  ------------------
  |  Branch (507:11): [True: 66, False: 0]
  ------------------
  508|     66|							break;
  509|      0|						c = *qpatnext++;
  510|      0|					} while (c == LBRACKET && *qpatnext == ':');
  ------------------
  |  |   91|      0|#define	LBRACKET	'['
  ------------------
  |  Branch (510:15): [True: 0, False: 0]
  |  Branch (510:32): [True: 0, False: 0]
  ------------------
  511|     66|					if (err == -1 &&
  ------------------
  |  Branch (511:10): [True: 27, False: 39]
  ------------------
  512|     27|					    !(pglob->gl_flags & GLOB_NOCHECK))
  ------------------
  |  |   82|     27|#define	GLOB_NOCHECK	0x0010	/* Return pattern itself if nothing matches. */
  ------------------
  |  Branch (512:10): [True: 27, False: 0]
  ------------------
  513|     27|						return GLOB_NOMATCH;
  ------------------
  |  |   88|     27|#define	GLOB_NOMATCH	(-3)	/* No match and GLOB_NOCHECK not set. */
  ------------------
  514|     39|					if (c == RBRACKET)
  ------------------
  |  |   96|     39|#define	RBRACKET	']'
  ------------------
  |  Branch (514:10): [True: 0, False: 39]
  ------------------
  515|      0|						break;
  516|     39|				}
  517|  3.65k|				*bufnext++ = CHAR(c);
  ------------------
  |  |  127|  3.65k|#define	CHAR(c)		((Char)((c)&M_ASCII))
  |  |  ------------------
  |  |  |  |  111|  3.65k|#define	M_ASCII		0x00ff
  |  |  ------------------
  ------------------
  518|  3.65k|				if (*qpatnext == RANGE &&
  ------------------
  |  |   95|  7.31k|#define	RANGE		'-'
  ------------------
  |  Branch (518:9): [True: 64, False: 3.59k]
  ------------------
  519|     64|				    (c = qpatnext[1]) != RBRACKET) {
  ------------------
  |  |   96|     64|#define	RBRACKET	']'
  ------------------
  |  Branch (519:9): [True: 59, False: 5]
  ------------------
  520|     59|					*bufnext++ = M_RNG;
  ------------------
  |  |  133|     59|#define	M_RNG		META('-')
  |  |  ------------------
  |  |  |  |  128|     59|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|     59|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  521|     59|					*bufnext++ = CHAR(c);
  ------------------
  |  |  127|     59|#define	CHAR(c)		((Char)((c)&M_ASCII))
  |  |  ------------------
  |  |  |  |  111|     59|#define	M_ASCII		0x00ff
  |  |  ------------------
  ------------------
  522|     59|					qpatnext += 2;
  523|     59|				}
  524|  3.65k|			} while ((c = *qpatnext++) != RBRACKET);
  ------------------
  |  |   96|  3.65k|#define	RBRACKET	']'
  ------------------
  |  Branch (524:13): [True: 3.60k, False: 55]
  ------------------
  525|     55|			pglob->gl_flags |= GLOB_MAGCHAR;
  ------------------
  |  |   93|     55|#define	GLOB_MAGCHAR	0x0100	/* Pattern had globbing characters. */
  ------------------
  526|     55|			*bufnext++ = M_END;
  ------------------
  |  |  130|     55|#define	M_END		META(']')
  |  |  ------------------
  |  |  |  |  128|     55|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|     55|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  527|     55|			break;
  528|    387|		case QUESTION:
  ------------------
  |  |   93|    387|#define	QUESTION	'?'
  ------------------
  |  Branch (528:3): [True: 387, False: 19.1k]
  ------------------
  529|    387|			pglob->gl_flags |= GLOB_MAGCHAR;
  ------------------
  |  |   93|    387|#define	GLOB_MAGCHAR	0x0100	/* Pattern had globbing characters. */
  ------------------
  530|    387|			*bufnext++ = M_ONE;
  ------------------
  |  |  132|    387|#define	M_ONE		META('?')
  |  |  ------------------
  |  |  |  |  128|    387|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    387|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  531|    387|			break;
  532|    258|		case STAR:
  ------------------
  |  |   98|    258|#define	STAR		'*'
  ------------------
  |  Branch (532:3): [True: 258, False: 19.2k]
  ------------------
  533|    258|			pglob->gl_flags |= GLOB_MAGCHAR;
  ------------------
  |  |   93|    258|#define	GLOB_MAGCHAR	0x0100	/* Pattern had globbing characters. */
  ------------------
  534|       |			/* collapse adjacent stars to one,
  535|       |			 * to avoid exponential behavior
  536|       |			 */
  537|    258|			if (bufnext == patbuf || bufnext[-1] != M_ALL)
  ------------------
  |  |  129|    258|#define	M_ALL		META('*')
  |  |  ------------------
  |  |  |  |  128|    258|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    258|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (537:8): [True: 0, False: 258]
  |  Branch (537:29): [True: 96, False: 162]
  ------------------
  538|     96|				*bufnext++ = M_ALL;
  ------------------
  |  |  129|     96|#define	M_ALL		META('*')
  |  |  ------------------
  |  |  |  |  128|     96|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|     96|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  539|    258|			break;
  540|  18.5k|		default:
  ------------------
  |  Branch (540:3): [True: 18.5k, False: 902]
  ------------------
  541|  18.5k|			*bufnext++ = CHAR(c);
  ------------------
  |  |  127|  18.5k|#define	CHAR(c)		((Char)((c)&M_ASCII))
  |  |  ------------------
  |  |  |  |  111|  18.5k|#define	M_ASCII		0x00ff
  |  |  ------------------
  ------------------
  542|  18.5k|			break;
  543|  19.4k|		}
  544|  19.4k|	}
  545|    765|	*bufnext = EOS;
  ------------------
  |  |   90|    765|#define	EOS		'\0'
  ------------------
  546|       |#ifdef DEBUG
  547|       |	qprintf("glob0:", patbuf);
  548|       |#endif
  549|       |
  550|    765|	if ((err = glob1(patbuf, patbuf+PATH_MAX-1, pglob, limitp)) != 0)
  ------------------
  |  Branch (550:6): [True: 0, False: 765]
  ------------------
  551|      0|		return(err);
  552|       |
  553|       |	/*
  554|       |	 * If there was no match we are going to append the pattern
  555|       |	 * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified
  556|       |	 * and the pattern did not contain any magic characters
  557|       |	 * GLOB_NOMAGIC is there just for compatibility with csh.
  558|       |	 */
  559|    765|	if (pglob->gl_pathc == oldpathc) {
  ------------------
  |  Branch (559:6): [True: 765, False: 0]
  ------------------
  560|    765|		if ((pglob->gl_flags & GLOB_NOCHECK) ||
  ------------------
  |  |   82|    765|#define	GLOB_NOCHECK	0x0010	/* Return pattern itself if nothing matches. */
  ------------------
  |  Branch (560:7): [True: 0, False: 765]
  ------------------
  561|    765|		    ((pglob->gl_flags & GLOB_NOMAGIC) &&
  ------------------
  |  |   94|    765|#define	GLOB_NOMAGIC	0x0200	/* GLOB_NOCHECK without magic chars (csh). */
  ------------------
  |  Branch (561:8): [True: 0, False: 765]
  ------------------
  562|      0|		    !(pglob->gl_flags & GLOB_MAGCHAR)))
  ------------------
  |  |   93|      0|#define	GLOB_MAGCHAR	0x0100	/* Pattern had globbing characters. */
  ------------------
  |  Branch (562:7): [True: 0, False: 0]
  ------------------
  563|      0|			return(globextend(pattern, pglob, limitp, NULL));
  564|    765|		else
  565|    765|			return(GLOB_NOMATCH);
  ------------------
  |  |   88|    765|#define	GLOB_NOMATCH	(-3)	/* No match and GLOB_NOCHECK not set. */
  ------------------
  566|    765|	}
  567|      0|	if (!(pglob->gl_flags & GLOB_NOSORT)) {
  ------------------
  |  |   83|      0|#define	GLOB_NOSORT	0x0020	/* Don't sort. */
  ------------------
  |  Branch (567:6): [True: 0, False: 0]
  ------------------
  568|      0|		if ((pglob->gl_flags & GLOB_KEEPSTAT)) {
  ------------------
  |  |   98|      0|#define	GLOB_KEEPSTAT	0x4000	/* Retain stat data for paths in gl_statv. */
  ------------------
  |  Branch (568:7): [True: 0, False: 0]
  ------------------
  569|       |			/* Keep the paths and stat info synced during sort */
  570|      0|			struct glob_path_stat *path_stat;
  571|      0|			size_t i;
  572|      0|			size_t n = pglob->gl_pathc - oldpathc;
  573|      0|			size_t o = pglob->gl_offs + oldpathc;
  574|       |
  575|      0|			if ((path_stat = calloc(n, sizeof(*path_stat))) == NULL)
  ------------------
  |  Branch (575:8): [True: 0, False: 0]
  ------------------
  576|      0|				return GLOB_NOSPACE;
  ------------------
  |  |   86|      0|#define	GLOB_NOSPACE	(-1)	/* Malloc call failed. */
  ------------------
  577|      0|			for (i = 0; i < n; i++) {
  ------------------
  |  Branch (577:16): [True: 0, False: 0]
  ------------------
  578|      0|				path_stat[i].gps_path = pglob->gl_pathv[o + i];
  579|      0|				path_stat[i].gps_stat = pglob->gl_statv[o + i];
  580|      0|			}
  581|      0|			qsort(path_stat, n, sizeof(*path_stat), compare_gps);
  582|      0|			for (i = 0; i < n; i++) {
  ------------------
  |  Branch (582:16): [True: 0, False: 0]
  ------------------
  583|      0|				pglob->gl_pathv[o + i] = path_stat[i].gps_path;
  584|      0|				pglob->gl_statv[o + i] = path_stat[i].gps_stat;
  585|      0|			}
  586|      0|			free(path_stat);
  587|      0|		} else {
  588|      0|			qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,
  589|      0|			    pglob->gl_pathc - oldpathc, sizeof(char *),
  590|      0|			    compare);
  591|      0|		}
  592|      0|	}
  593|      0|	return(0);
  594|      0|}
glob.c:globtilde:
  365|    792|{
  366|    792|	struct passwd *pwd;
  367|    792|	char *h;
  368|    792|	const Char *p;
  369|    792|	Char *b, *eb;
  370|       |
  371|    792|	if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE))
  ------------------
  |  |   99|  1.58k|#define	TILDE		'~'
  ------------------
              	if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE))
  ------------------
  |  |   96|      0|#define	GLOB_TILDE	0x0800	/* Expand tilde names from the passwd file. */
  ------------------
  |  Branch (371:6): [True: 792, False: 0]
  |  Branch (371:27): [True: 0, False: 0]
  ------------------
  372|    792|		return pattern;
  373|       |
  374|       |	/* Copy up to the end of the string or / */
  375|      0|	eb = &patbuf[patbuf_len - 1];
  376|      0|	for (p = pattern + 1, h = (char *) patbuf;
  377|      0|	    h < (char *)eb && *p && *p != SLASH; *h++ = *p++)
  ------------------
  |  |  103|      0|#define	SLASH		'/'
  ------------------
  |  Branch (377:6): [True: 0, False: 0]
  |  Branch (377:24): [True: 0, False: 0]
  |  Branch (377:30): [True: 0, False: 0]
  ------------------
  378|      0|		;
  379|       |
  380|      0|	*h = EOS;
  ------------------
  |  |   90|      0|#define	EOS		'\0'
  ------------------
  381|       |
  382|       |#if 0
  383|       |	if (h == (char *)eb)
  384|       |		return what;
  385|       |#endif
  386|       |
  387|      0|	if (((char *) patbuf)[0] == EOS) {
  ------------------
  |  |   90|      0|#define	EOS		'\0'
  ------------------
  |  Branch (387:6): [True: 0, False: 0]
  ------------------
  388|       |		/*
  389|       |		 * handle a plain ~ or ~/ by expanding $HOME
  390|       |		 * first and then trying the password file
  391|       |		 */
  392|       |#if 0
  393|       |		if (issetugid() != 0 || (h = getenv("HOME")) == NULL) {
  394|       |#endif
  395|      0|		if ((getuid() != geteuid()) || (h = getenv("HOME")) == NULL) {
  ------------------
  |  Branch (395:7): [True: 0, False: 0]
  |  Branch (395:34): [True: 0, False: 0]
  ------------------
  396|      0|			if ((pwd = getpwuid(getuid())) == NULL)
  ------------------
  |  Branch (396:8): [True: 0, False: 0]
  ------------------
  397|      0|				return pattern;
  398|      0|			else
  399|      0|				h = pwd->pw_dir;
  400|      0|		}
  401|      0|	} else {
  402|       |		/*
  403|       |		 * Expand a ~user
  404|       |		 */
  405|      0|		if ((pwd = getpwnam((char*) patbuf)) == NULL)
  ------------------
  |  Branch (405:7): [True: 0, False: 0]
  ------------------
  406|      0|			return pattern;
  407|      0|		else
  408|      0|			h = pwd->pw_dir;
  409|      0|	}
  410|       |
  411|       |	/* Copy the home directory */
  412|      0|	for (b = patbuf; b < eb && *h; *b++ = *h++)
  ------------------
  |  Branch (412:19): [True: 0, False: 0]
  |  Branch (412:29): [True: 0, False: 0]
  ------------------
  413|      0|		;
  414|       |
  415|       |	/* Append the rest of the pattern */
  416|      0|	while (b < eb && (*b++ = *p++) != EOS)
  ------------------
  |  |   90|      0|#define	EOS		'\0'
  ------------------
  |  Branch (416:9): [True: 0, False: 0]
  |  Branch (416:19): [True: 0, False: 0]
  ------------------
  417|      0|		;
  418|      0|	*b = EOS;
  ------------------
  |  |   90|      0|#define	EOS		'\0'
  ------------------
  419|       |
  420|      0|	return patbuf;
  421|      0|}
glob.c:g_charclass:
  440|     66|{
  441|     66|	const Char *pattern = *patternp + 1;
  442|     66|	Char *bufnext = *bufnextp;
  443|     66|	const Char *colon;
  444|     66|	struct cclass *cc;
  445|     66|	size_t len;
  446|       |
  447|     66|	if ((colon = g_strchr(pattern, ':')) == NULL || colon[1] != ']')
  ------------------
  |  Branch (447:6): [True: 16, False: 50]
  |  Branch (447:50): [True: 23, False: 27]
  ------------------
  448|     39|		return 1;	/* not a character class */
  449|       |
  450|     27|	len = (size_t)(colon - pattern);
  451|    351|	for (cc = cclasses; cc->name != NULL; cc++) {
  ------------------
  |  Branch (451:22): [True: 324, False: 27]
  ------------------
  452|    324|		if (!g_strncmp(pattern, cc->name, len) && cc->name[len] == '\0')
  ------------------
  |  Branch (452:7): [True: 190, False: 134]
  |  Branch (452:45): [True: 0, False: 190]
  ------------------
  453|      0|			break;
  454|    324|	}
  455|     27|	if (cc->name == NULL)
  ------------------
  |  Branch (455:6): [True: 27, False: 0]
  ------------------
  456|     27|		return -1;	/* invalid character class */
  457|      0|	*bufnext++ = M_CLASS;
  ------------------
  |  |  135|      0|#define	M_CLASS		META(':')
  |  |  ------------------
  |  |  |  |  128|      0|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      0|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  458|      0|	*bufnext++ = (Char)(cc - &cclasses[0]);
  459|      0|	*bufnextp = bufnext;
  460|      0|	*patternp += len + 3;
  461|       |
  462|      0|	return 0;
  463|     27|}
glob.c:g_strncmp:
  425|    324|{
  426|    324|	int rv = 0;
  427|       |
  428|    336|	while (n--) {
  ------------------
  |  Branch (428:9): [True: 146, False: 190]
  ------------------
  429|    146|		rv = *(Char *)s1 - *(const unsigned char *)s2++;
  430|    146|		if (rv)
  ------------------
  |  Branch (430:7): [True: 134, False: 12]
  ------------------
  431|    134|			break;
  432|     12|		if (*s1++ == '\0')
  ------------------
  |  Branch (432:7): [True: 0, False: 12]
  ------------------
  433|      0|			break;
  434|     12|	}
  435|    324|	return rv;
  436|    324|}
glob.c:glob1:
  613|    765|{
  614|    765|	Char pathbuf[PATH_MAX];
  615|       |
  616|       |	/* A null pathname is invalid -- POSIX 1003.1 sect. 2.4. */
  617|    765|	if (*pattern == EOS)
  ------------------
  |  |   90|    765|#define	EOS		'\0'
  ------------------
  |  Branch (617:6): [True: 0, False: 765]
  ------------------
  618|      0|		return(0);
  619|    765|	return(glob2(pathbuf, pathbuf+PATH_MAX-1,
  620|       |	    pathbuf, pathbuf+PATH_MAX-1,
  621|    765|	    pattern, pattern_last, pglob, limitp));
  622|    765|}
glob.c:glob2:
  632|  1.09k|{
  633|  1.09k|	struct stat sb;
  634|  1.09k|	Char *p, *q;
  635|  1.09k|	int anymeta;
  636|       |
  637|       |	/*
  638|       |	 * Loop over pattern segments until end of pattern or until
  639|       |	 * segment with meta character found.
  640|       |	 */
  641|  5.44k|	for (anymeta = 0;;) {
  642|  5.44k|		if (*pattern == EOS) {		/* End of pattern? */
  ------------------
  |  |   90|  5.44k|#define	EOS		'\0'
  ------------------
  |  Branch (642:7): [True: 797, False: 4.64k]
  ------------------
  643|    797|			*pathend = EOS;
  ------------------
  |  |   90|    797|#define	EOS		'\0'
  ------------------
  644|       |
  645|    797|			if ((pglob->gl_flags & GLOB_LIMIT) &&
  ------------------
  |  |   97|    797|#define GLOB_LIMIT	0x2000	/* Limit pattern match output to ARG_MAX */
  ------------------
  |  Branch (645:8): [True: 0, False: 797]
  ------------------
  646|      0|			    limitp->glim_stat++ >= GLOB_LIMIT_STAT) {
  ------------------
  |  |  139|      0|#define	GLOB_LIMIT_STAT		2048
  ------------------
  |  Branch (646:8): [True: 0, False: 0]
  ------------------
  647|      0|				errno = 0;
  648|      0|				*pathend++ = SEP;
  ------------------
  |  |   97|      0|#define	SEP		'/'
  ------------------
  649|      0|				*pathend = EOS;
  ------------------
  |  |   90|      0|#define	EOS		'\0'
  ------------------
  650|      0|				return(GLOB_NOSPACE);
  ------------------
  |  |   86|      0|#define	GLOB_NOSPACE	(-1)	/* Malloc call failed. */
  ------------------
  651|      0|			}
  652|    797|			if (g_lstat(pathbuf, &sb, pglob))
  ------------------
  |  Branch (652:8): [True: 797, False: 0]
  ------------------
  653|    797|				return(0);
  654|       |
  655|      0|			if (((pglob->gl_flags & GLOB_MARK) &&
  ------------------
  |  |   81|      0|#define	GLOB_MARK	0x0008	/* Append / to matching directories. */
  ------------------
  |  Branch (655:9): [True: 0, False: 0]
  ------------------
  656|      0|			    pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) ||
  ------------------
  |  |   97|      0|#define	SEP		'/'
  ------------------
  |  Branch (656:8): [True: 0, False: 0]
  |  Branch (656:32): [True: 0, False: 0]
  ------------------
  657|      0|			    (S_ISLNK(sb.st_mode) &&
  ------------------
  |  Branch (657:9): [True: 0, False: 0]
  ------------------
  658|      0|			    (g_stat(pathbuf, &sb, pglob) == 0) &&
  ------------------
  |  Branch (658:8): [True: 0, False: 0]
  ------------------
  659|      0|			    S_ISDIR(sb.st_mode)))) {
  ------------------
  |  Branch (659:8): [True: 0, False: 0]
  ------------------
  660|      0|				if (pathend+1 > pathend_last)
  ------------------
  |  Branch (660:9): [True: 0, False: 0]
  ------------------
  661|      0|					return (1);
  662|      0|				*pathend++ = SEP;
  ------------------
  |  |   97|      0|#define	SEP		'/'
  ------------------
  663|      0|				*pathend = EOS;
  ------------------
  |  |   90|      0|#define	EOS		'\0'
  ------------------
  664|      0|			}
  665|      0|			++pglob->gl_matchc;
  666|      0|			return(globextend(pathbuf, pglob, limitp, &sb));
  667|      0|		}
  668|       |
  669|       |		/* Find end of next segment, copy tentatively to pathend. */
  670|  4.64k|		q = pathend;
  671|  4.64k|		p = pattern;
  672|  29.0k|		while (*p != EOS && *p != SEP) {
  ------------------
  |  |   90|  58.1k|#define	EOS		'\0'
  ------------------
              		while (*p != EOS && *p != SEP) {
  ------------------
  |  |   97|  28.0k|#define	SEP		'/'
  ------------------
  |  Branch (672:10): [True: 28.0k, False: 1.04k]
  |  Branch (672:23): [True: 24.4k, False: 3.60k]
  ------------------
  673|  24.4k|			if (ismeta(*p))
  ------------------
  |  |  136|  24.4k|#define	ismeta(c)	(((c)&M_QUOTE) != 0)
  |  |  ------------------
  |  |  |  |  108|  24.4k|#define	M_QUOTE		0x8000
  |  |  ------------------
  |  |  |  Branch (136:19): [True: 756, False: 23.6k]
  |  |  ------------------
  ------------------
  674|    756|				anymeta = 1;
  675|  24.4k|			if (q+1 > pathend_last)
  ------------------
  |  Branch (675:8): [True: 0, False: 24.4k]
  ------------------
  676|      0|				return (1);
  677|  24.4k|			*q++ = *p++;
  678|  24.4k|		}
  679|       |
  680|  4.64k|		if (!anymeta) {		/* No expansion, do next segment. */
  ------------------
  |  Branch (680:7): [True: 4.35k, False: 298]
  ------------------
  681|  4.35k|			pathend = q;
  682|  4.35k|			pattern = p;
  683|  8.47k|			while (*pattern == SEP) {
  ------------------
  |  |   97|  8.47k|#define	SEP		'/'
  ------------------
  |  Branch (683:11): [True: 4.12k, False: 4.35k]
  ------------------
  684|  4.12k|				if (pathend+1 > pathend_last)
  ------------------
  |  Branch (684:9): [True: 0, False: 4.12k]
  ------------------
  685|      0|					return (1);
  686|  4.12k|				*pathend++ = *pattern++;
  687|  4.12k|			}
  688|  4.35k|		} else
  689|       |			/* Need expansion, recurse. */
  690|    298|			return(glob3(pathbuf, pathbuf_last, pathend,
  691|    298|			    pathend_last, pattern, p, pattern_last,
  692|    298|			    pglob, limitp));
  693|  4.64k|	}
  694|       |	/* NOTREACHED */
  695|  1.09k|}
glob.c:g_lstat:
 1014|    797|{
 1015|    797|	char buf[PATH_MAX];
 1016|       |
 1017|    797|	if (g_Ctoc(fn, buf, sizeof(buf)))
  ------------------
  |  Branch (1017:6): [True: 0, False: 797]
  ------------------
 1018|      0|		return(-1);
 1019|    797|	if (pglob->gl_flags & GLOB_ALTDIRFUNC)
  ------------------
  |  |   91|    797|#define	GLOB_ALTDIRFUNC	0x0040	/* Use alternately specified directory funcs. */
  ------------------
  |  Branch (1019:6): [True: 0, False: 797]
  ------------------
 1020|      0|		return((*pglob->gl_lstat)(buf, sb));
 1021|    797|	return(lstat(buf, sb));
 1022|    797|}
glob.c:g_Ctoc:
 1048|  1.09k|{
 1049|       |
 1050|  26.3k|	while (len--) {
  ------------------
  |  Branch (1050:9): [True: 26.3k, False: 0]
  ------------------
 1051|  26.3k|		if ((*buf++ = *str++) == EOS)
  ------------------
  |  |   90|  26.3k|#define	EOS		'\0'
  ------------------
  |  Branch (1051:7): [True: 1.09k, False: 25.2k]
  ------------------
 1052|  1.09k|			return (0);
 1053|  26.3k|	}
 1054|      0|	return (1);
 1055|  1.09k|}
glob.c:glob3:
  701|    298|{
  702|    298|	struct dirent *dp;
  703|    298|	DIR *dirp;
  704|    298|	int err;
  705|    298|	char buf[PATH_MAX];
  706|       |
  707|       |	/*
  708|       |	 * The readdirfunc declaration can't be prototyped, because it is
  709|       |	 * assigned, below, to two functions which are prototyped in glob.h
  710|       |	 * and dirent.h as taking pointers to differently typed opaque
  711|       |	 * structures.
  712|       |	 */
  713|    298|	struct dirent *(*readdirfunc)(void *);
  714|       |
  715|    298|	if (pathend > pathend_last)
  ------------------
  |  Branch (715:6): [True: 0, False: 298]
  ------------------
  716|      0|		return (1);
  717|    298|	*pathend = EOS;
  ------------------
  |  |   90|    298|#define	EOS		'\0'
  ------------------
  718|    298|	errno = 0;
  719|       |
  720|    298|	if ((dirp = g_opendir(pathbuf, pglob)) == NULL) {
  ------------------
  |  Branch (720:6): [True: 139, False: 159]
  ------------------
  721|       |		/* TODO: don't call for ENOENT or ENOTDIR? */
  722|    139|		if (pglob->gl_errfunc) {
  ------------------
  |  Branch (722:7): [True: 0, False: 139]
  ------------------
  723|      0|			if (g_Ctoc(pathbuf, buf, sizeof(buf)))
  ------------------
  |  Branch (723:8): [True: 0, False: 0]
  ------------------
  724|      0|				return(GLOB_ABORTED);
  ------------------
  |  |   87|      0|#define	GLOB_ABORTED	(-2)	/* Unignored error. */
  ------------------
  725|      0|			if (pglob->gl_errfunc(buf, errno) ||
  ------------------
  |  Branch (725:8): [True: 0, False: 0]
  ------------------
  726|      0|			    pglob->gl_flags & GLOB_ERR)
  ------------------
  |  |   80|      0|#define	GLOB_ERR	0x0004	/* Return on error. */
  ------------------
  |  Branch (726:8): [True: 0, False: 0]
  ------------------
  727|      0|				return(GLOB_ABORTED);
  ------------------
  |  |   87|      0|#define	GLOB_ABORTED	(-2)	/* Unignored error. */
  ------------------
  728|      0|		}
  729|    139|		return(0);
  730|    139|	}
  731|       |
  732|    159|	err = 0;
  733|       |
  734|       |	/* Search directory for matching names. */
  735|    159|	if (pglob->gl_flags & GLOB_ALTDIRFUNC)
  ------------------
  |  |   91|    159|#define	GLOB_ALTDIRFUNC	0x0040	/* Use alternately specified directory funcs. */
  ------------------
  |  Branch (735:6): [True: 0, False: 159]
  ------------------
  736|      0|		readdirfunc = pglob->gl_readdir;
  737|    159|	else
  738|    159|		readdirfunc = (struct dirent *(*)(void *))readdir;
  739|  2.13k|	while ((dp = (*readdirfunc)(dirp))) {
  ------------------
  |  Branch (739:9): [True: 1.98k, False: 159]
  ------------------
  740|  1.98k|		u_char *sc;
  741|  1.98k|		Char *dc;
  742|       |
  743|  1.98k|		if ((pglob->gl_flags & GLOB_LIMIT) &&
  ------------------
  |  |   97|  1.98k|#define GLOB_LIMIT	0x2000	/* Limit pattern match output to ARG_MAX */
  ------------------
  |  Branch (743:7): [True: 0, False: 1.98k]
  ------------------
  744|      0|		    limitp->glim_readdir++ >= GLOB_LIMIT_READDIR) {
  ------------------
  |  |  140|      0|#define	GLOB_LIMIT_READDIR	16384
  ------------------
  |  Branch (744:7): [True: 0, False: 0]
  ------------------
  745|      0|			errno = 0;
  746|      0|			*pathend++ = SEP;
  ------------------
  |  |   97|      0|#define	SEP		'/'
  ------------------
  747|      0|			*pathend = EOS;
  ------------------
  |  |   90|      0|#define	EOS		'\0'
  ------------------
  748|      0|			err = GLOB_NOSPACE;
  ------------------
  |  |   86|      0|#define	GLOB_NOSPACE	(-1)	/* Malloc call failed. */
  ------------------
  749|      0|			break;
  750|      0|		}
  751|       |
  752|       |		/* Initial DOT must be matched literally. */
  753|  1.98k|		if (dp->d_name[0] == DOT && *pattern != DOT)
  ------------------
  |  |   89|  3.96k|#define	DOT		'.'
  ------------------
              		if (dp->d_name[0] == DOT && *pattern != DOT)
  ------------------
  |  |   89|    372|#define	DOT		'.'
  ------------------
  |  Branch (753:7): [True: 372, False: 1.60k]
  |  Branch (753:31): [True: 306, False: 66]
  ------------------
  754|    306|			continue;
  755|  1.67k|		dc = pathend;
  756|  1.67k|		sc = (u_char *) dp->d_name;
  757|  9.91k|		while (dc < pathend_last && (*dc++ = *sc++) != EOS)
  ------------------
  |  |   90|  9.91k|#define	EOS		'\0'
  ------------------
  |  Branch (757:10): [True: 9.91k, False: 0]
  |  Branch (757:31): [True: 8.23k, False: 1.67k]
  ------------------
  758|  8.23k|			;
  759|  1.67k|		if (dc >= pathend_last) {
  ------------------
  |  Branch (759:7): [True: 0, False: 1.67k]
  ------------------
  760|      0|			*dc = EOS;
  ------------------
  |  |   90|      0|#define	EOS		'\0'
  ------------------
  761|      0|			err = 1;
  762|      0|			break;
  763|      0|		}
  764|       |
  765|  1.67k|		if (!match(pathend, pattern, restpattern)) {
  ------------------
  |  Branch (765:7): [True: 1.34k, False: 330]
  ------------------
  766|  1.34k|			*pathend = EOS;
  ------------------
  |  |   90|  1.34k|#define	EOS		'\0'
  ------------------
  767|  1.34k|			continue;
  768|  1.34k|		}
  769|    330|		err = glob2(pathbuf, pathbuf_last, --dc, pathend_last,
  770|    330|		    restpattern, restpattern_last, pglob, limitp);
  771|    330|		if (err)
  ------------------
  |  Branch (771:7): [True: 0, False: 330]
  ------------------
  772|      0|			break;
  773|    330|	}
  774|       |
  775|    159|	if (pglob->gl_flags & GLOB_ALTDIRFUNC)
  ------------------
  |  |   91|    159|#define	GLOB_ALTDIRFUNC	0x0040	/* Use alternately specified directory funcs. */
  ------------------
  |  Branch (775:6): [True: 0, False: 159]
  ------------------
  776|      0|		(*pglob->gl_closedir)(dirp);
  777|    159|	else
  778|    159|		closedir(dirp);
  779|    159|	return(err);
  780|    298|}
glob.c:g_opendir:
  996|    298|{
  997|    298|	char buf[PATH_MAX];
  998|       |
  999|    298|	if (!*str)
  ------------------
  |  Branch (999:6): [True: 0, False: 298]
  ------------------
 1000|      0|		strlcpy(buf, ".", sizeof buf);
 1001|    298|	else {
 1002|    298|		if (g_Ctoc(str, buf, sizeof(buf)))
  ------------------
  |  Branch (1002:7): [True: 0, False: 298]
  ------------------
 1003|      0|			return(NULL);
 1004|    298|	}
 1005|       |
 1006|    298|	if (pglob->gl_flags & GLOB_ALTDIRFUNC)
  ------------------
  |  |   91|    298|#define	GLOB_ALTDIRFUNC	0x0040	/* Use alternately specified directory funcs. */
  ------------------
  |  Branch (1006:6): [True: 0, False: 298]
  ------------------
 1007|      0|		return((*pglob->gl_opendir)(buf));
 1008|       |
 1009|    298|	return(opendir(buf));
 1010|    298|}
glob.c:match:
  905|  1.67k|{
  906|  1.67k|	int ok, negate_range;
  907|  1.67k|	Char c, k;
  908|  1.67k|	Char *nextp = NULL;
  909|  1.67k|	Char *nextn = NULL;
  910|       |
  911|  3.30k|loop:
  912|  9.24k|	while (pat < patend) {
  ------------------
  |  Branch (912:9): [True: 8.09k, False: 1.14k]
  ------------------
  913|  8.09k|		c = *pat++;
  914|  8.09k|		switch (c & M_MASK) {
  ------------------
  |  |  110|  8.09k|#define	M_MASK		0xffff
  ------------------
  915|  2.35k|		case M_ALL:
  ------------------
  |  |  129|  2.35k|#define	M_ALL		META('*')
  |  |  ------------------
  |  |  |  |  128|  2.35k|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  2.35k|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (915:3): [True: 2.35k, False: 5.74k]
  ------------------
  916|  2.35k|			while (pat < patend && (*pat & M_MASK) == M_ALL)
  ------------------
  |  |  110|  2.33k|#define	M_MASK		0xffff
  ------------------
              			while (pat < patend && (*pat & M_MASK) == M_ALL)
  ------------------
  |  |  129|  2.33k|#define	M_ALL		META('*')
  |  |  ------------------
  |  |  |  |  128|  2.33k|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  2.33k|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (916:11): [True: 2.33k, False: 22]
  |  Branch (916:27): [True: 0, False: 2.33k]
  ------------------
  917|      0|				pat++;	/* eat consecutive '*' */
  918|  2.35k|			if (pat == patend)
  ------------------
  |  Branch (918:8): [True: 22, False: 2.33k]
  ------------------
  919|     22|				return(1);
  920|  2.33k|			if (*name == EOS)
  ------------------
  |  |   90|  2.33k|#define	EOS		'\0'
  ------------------
  |  Branch (920:8): [True: 420, False: 1.91k]
  ------------------
  921|    420|				return(0);
  922|  1.91k|			nextn = name + 1;
  923|  1.91k|			nextp = pat - 1;
  924|  1.91k|			break;
  925|  3.86k|		case M_ONE:
  ------------------
  |  |  132|  3.86k|#define	M_ONE		META('?')
  |  |  ------------------
  |  |  |  |  128|  3.86k|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  3.86k|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (925:3): [True: 3.86k, False: 4.23k]
  ------------------
  926|  3.86k|			if (*name++ == EOS)
  ------------------
  |  |   90|  3.86k|#define	EOS		'\0'
  ------------------
  |  Branch (926:8): [True: 122, False: 3.74k]
  ------------------
  927|    122|				goto fail;
  928|  3.74k|			break;
  929|  3.74k|		case M_SET:
  ------------------
  |  |  134|    382|#define	M_SET		META('[')
  |  |  ------------------
  |  |  |  |  128|    382|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    382|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (929:3): [True: 382, False: 7.71k]
  ------------------
  930|    382|			ok = 0;
  931|    382|			if ((k = *name++) == EOS)
  ------------------
  |  |   90|    382|#define	EOS		'\0'
  ------------------
  |  Branch (931:8): [True: 17, False: 365]
  ------------------
  932|     17|				goto fail;
  933|    365|			if ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS)
  ------------------
  |  |  110|    365|#define	M_MASK		0xffff
  ------------------
              			if ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS)
  ------------------
  |  |  131|    365|#define	M_NOT		META('!')
  |  |  ------------------
  |  |  |  |  128|    365|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    365|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              			if ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS)
  ------------------
  |  |   90|    365|#define	EOS		'\0'
  ------------------
  |  Branch (933:8): [True: 30, False: 335]
  ------------------
  934|     30|				++pat;
  935|  15.2k|			while (((c = *pat++) & M_MASK) != M_END) {
  ------------------
  |  |  110|  15.2k|#define	M_MASK		0xffff
  ------------------
              			while (((c = *pat++) & M_MASK) != M_END) {
  ------------------
  |  |  130|  15.2k|#define	M_END		META(']')
  |  |  ------------------
  |  |  |  |  128|  15.2k|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  15.2k|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (935:11): [True: 14.8k, False: 365]
  ------------------
  936|  14.8k|				if ((c & M_MASK) == M_CLASS) {
  ------------------
  |  |  110|  14.8k|#define	M_MASK		0xffff
  ------------------
              				if ((c & M_MASK) == M_CLASS) {
  ------------------
  |  |  135|  14.8k|#define	M_CLASS		META(':')
  |  |  ------------------
  |  |  |  |  128|  14.8k|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  14.8k|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (936:9): [True: 0, False: 14.8k]
  ------------------
  937|      0|					Char idx = *pat & M_MASK;
  ------------------
  |  |  110|      0|#define	M_MASK		0xffff
  ------------------
  938|      0|					if (idx < NCCLASSES &&
  ------------------
  |  |   31|      0|#define NCCLASSES	(sizeof(cclasses) / sizeof(cclasses[0]) - 1)
  ------------------
  |  Branch (938:10): [True: 0, False: 0]
  ------------------
  939|      0|					    cclasses[idx].isctype(k))
  ------------------
  |  Branch (939:10): [True: 0, False: 0]
  ------------------
  940|      0|						ok = 1;
  941|      0|					++pat;
  942|      0|				}
  943|  14.8k|				if ((*pat & M_MASK) == M_RNG) {
  ------------------
  |  |  110|  14.8k|#define	M_MASK		0xffff
  ------------------
              				if ((*pat & M_MASK) == M_RNG) {
  ------------------
  |  |  133|  14.8k|#define	M_RNG		META('-')
  |  |  ------------------
  |  |  |  |  128|  14.8k|#define	META(c)		((Char)((c)|M_QUOTE))
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  14.8k|#define	M_QUOTE		0x8000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (943:9): [True: 644, False: 14.2k]
  ------------------
  944|    644|					if (c <= k && k <= pat[1])
  ------------------
  |  Branch (944:10): [True: 335, False: 309]
  |  Branch (944:20): [True: 220, False: 115]
  ------------------
  945|    220|						ok = 1;
  946|    644|					pat += 2;
  947|  14.2k|				} else if (c == k)
  ------------------
  |  Branch (947:16): [True: 265, False: 13.9k]
  ------------------
  948|    265|					ok = 1;
  949|  14.8k|			}
  950|    365|			if (ok == negate_range)
  ------------------
  |  Branch (950:8): [True: 162, False: 203]
  ------------------
  951|    162|				goto fail;
  952|    203|			break;
  953|  1.49k|		default:
  ------------------
  |  Branch (953:3): [True: 1.49k, False: 6.60k]
  ------------------
  954|  1.49k|			if (*name++ != c)
  ------------------
  |  Branch (954:8): [True: 1.41k, False: 82]
  ------------------
  955|  1.41k|				goto fail;
  956|     82|			break;
  957|  8.09k|		}
  958|  8.09k|	}
  959|  1.14k|	if (*name == EOS)
  ------------------
  |  |   90|  1.14k|#define	EOS		'\0'
  ------------------
  |  Branch (959:6): [True: 308, False: 838]
  ------------------
  960|    308|		return(1);
  961|       |
  962|  2.55k|fail:
  963|  2.55k|	if (nextn) {
  ------------------
  |  Branch (963:6): [True: 1.62k, False: 924]
  ------------------
  964|  1.62k|		pat = nextp;
  965|  1.62k|		name = nextn;
  966|  1.62k|		goto loop;
  967|  1.62k|	}
  968|    924|	return(0);
  969|  2.55k|}

_ssh_mkstemp:
   50|    285|{
   51|    285|	mode_t mask;
   52|    285|	int ret;
   53|       |
   54|    285|	mask = umask(0177);
   55|    285|	ret = mkstemp(template);
   56|    285|	(void)umask(mask);
   57|    285|	return ret;
   58|    285|}

recallocarray:
   37|  1.47k|{
   38|  1.47k|	size_t oldsize, newsize;
   39|  1.47k|	void *newptr;
   40|       |
   41|  1.47k|	if (ptr == NULL)
  ------------------
  |  Branch (41:6): [True: 89, False: 1.38k]
  ------------------
   42|     89|		return calloc(newnmemb, size);
   43|       |
   44|  1.38k|	if ((newnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
  ------------------
  |  |   33|  2.76k|#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
  ------------------
              	if ((newnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
  ------------------
  |  |   33|  1.38k|#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
  ------------------
  |  Branch (44:7): [True: 0, False: 1.38k]
  |  Branch (44:38): [True: 0, False: 1.38k]
  ------------------
   45|  1.38k|	    newnmemb > 0 && SIZE_MAX / newnmemb < size) {
  ------------------
  |  Branch (45:6): [True: 0, False: 0]
  |  Branch (45:22): [True: 0, False: 0]
  ------------------
   46|      0|		errno = ENOMEM;
   47|      0|		return NULL;
   48|      0|	}
   49|  1.38k|	newsize = newnmemb * size;
   50|       |
   51|  1.38k|	if ((oldnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
  ------------------
  |  |   33|  2.76k|#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
  ------------------
              	if ((oldnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
  ------------------
  |  |   33|  1.38k|#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
  ------------------
  |  Branch (51:7): [True: 0, False: 1.38k]
  |  Branch (51:38): [True: 0, False: 1.38k]
  ------------------
   52|  1.38k|	    oldnmemb > 0 && SIZE_MAX / oldnmemb < size) {
  ------------------
  |  Branch (52:6): [True: 0, False: 0]
  |  Branch (52:22): [True: 0, False: 0]
  ------------------
   53|      0|		errno = EINVAL;
   54|      0|		return NULL;
   55|      0|	}
   56|  1.38k|	oldsize = oldnmemb * size;
   57|       |	
   58|       |	/*
   59|       |	 * Don't bother too much if we're shrinking just a bit,
   60|       |	 * we do not shrink for series of small steps, oh well.
   61|       |	 */
   62|  1.38k|	if (newsize <= oldsize) {
  ------------------
  |  Branch (62:6): [True: 349, False: 1.03k]
  ------------------
   63|    349|		size_t d = oldsize - newsize;
   64|       |
   65|    349|		if (d < oldsize / 2 && d < (size_t)getpagesize()) {
  ------------------
  |  Branch (65:7): [True: 126, False: 223]
  |  Branch (65:26): [True: 126, False: 0]
  ------------------
   66|    126|			memset((char *)ptr + newsize, 0, d);
   67|    126|			return ptr;
   68|    126|		}
   69|    349|	}
   70|       |
   71|  1.25k|	newptr = malloc(newsize);
   72|  1.25k|	if (newptr == NULL)
  ------------------
  |  Branch (72:6): [True: 0, False: 1.25k]
  ------------------
   73|      0|		return NULL;
   74|       |
   75|  1.25k|	if (newsize > oldsize) {
  ------------------
  |  Branch (75:6): [True: 1.03k, False: 223]
  ------------------
   76|  1.03k|		memcpy(newptr, ptr, oldsize);
   77|  1.03k|		memset((char *)newptr + oldsize, 0, newsize - oldsize);
   78|  1.03k|	} else
   79|    223|		memcpy(newptr, ptr, newsize);
   80|       |
   81|  1.25k|	explicit_bzero(ptr, oldsize);
   82|  1.25k|	free(ptr);
   83|       |
   84|  1.25k|	return newptr;
   85|  1.25k|}

strlcat:
   36|  15.9k|{
   37|  15.9k|	char *d = dst;
   38|  15.9k|	const char *s = src;
   39|  15.9k|	size_t n = siz;
   40|  15.9k|	size_t dlen;
   41|       |
   42|       |	/* Find the end of dst and adjust bytes left but don't go past end */
   43|   319k|	while (n-- != 0 && *d != '\0')
  ------------------
  |  Branch (43:9): [True: 319k, False: 0]
  |  Branch (43:21): [True: 303k, False: 15.9k]
  ------------------
   44|   303k|		d++;
   45|  15.9k|	dlen = d - dst;
   46|  15.9k|	n = siz - dlen;
   47|       |
   48|  15.9k|	if (n == 0)
  ------------------
  |  Branch (48:6): [True: 0, False: 15.9k]
  ------------------
   49|      0|		return(dlen + strlen(s));
   50|  47.8k|	while (*s != '\0') {
  ------------------
  |  Branch (50:9): [True: 31.9k, False: 15.9k]
  ------------------
   51|  31.9k|		if (n != 1) {
  ------------------
  |  Branch (51:7): [True: 31.9k, False: 0]
  ------------------
   52|  31.9k|			*d++ = *s;
   53|  31.9k|			n--;
   54|  31.9k|		}
   55|  31.9k|		s++;
   56|  31.9k|	}
   57|  15.9k|	*d = '\0';
   58|       |
   59|  15.9k|	return(dlen + (s - src));	/* count does not include NUL */
   60|  15.9k|}

strlcpy:
   34|    806|{
   35|    806|	char *d = dst;
   36|    806|	const char *s = src;
   37|    806|	size_t n = siz;
   38|       |
   39|       |	/* Copy as many bytes as will fit */
   40|    806|	if (n != 0) {
  ------------------
  |  Branch (40:6): [True: 806, False: 0]
  ------------------
   41|  10.5k|		while (--n != 0) {
  ------------------
  |  Branch (41:10): [True: 10.4k, False: 6]
  ------------------
   42|  10.4k|			if ((*d++ = *s++) == '\0')
  ------------------
  |  Branch (42:8): [True: 800, False: 9.69k]
  ------------------
   43|    800|				break;
   44|  10.4k|		}
   45|    806|	}
   46|       |
   47|       |	/* Not enough room in dst, add NUL and traverse rest of src */
   48|    806|	if (n == 0) {
  ------------------
  |  Branch (48:6): [True: 6, False: 800]
  ------------------
   49|      6|		if (siz != 0)
  ------------------
  |  Branch (49:7): [True: 6, False: 0]
  ------------------
   50|      6|			*d = '\0';		/* NUL-terminate dst */
   51|     32|		while (*s++)
  ------------------
  |  Branch (51:10): [True: 26, False: 6]
  ------------------
   52|     26|			;
   53|      6|	}
   54|       |
   55|    806|	return(s - src - 1);	/* count does not include NUL */
   56|    806|}

strtonum:
   36|     42|{
   37|     42|	long long ll = 0;
   38|     42|	char *ep;
   39|     42|	int error = 0;
   40|     42|	struct errval {
   41|     42|		const char *errstr;
   42|     42|		int err;
   43|     42|	} ev[4] = {
   44|     42|		{ NULL,		0 },
   45|     42|		{ "invalid",	EINVAL },
   46|     42|		{ "too small",	ERANGE },
   47|     42|		{ "too large",	ERANGE },
   48|     42|	};
   49|       |
   50|     42|	ev[0].err = errno;
   51|     42|	errno = 0;
   52|     42|	if (minval > maxval)
  ------------------
  |  Branch (52:6): [True: 0, False: 42]
  ------------------
   53|      0|		error = INVALID;
  ------------------
  |  |   29|      0|#define INVALID		1
  ------------------
   54|     42|	else {
   55|     42|		ll = strtoll(numstr, &ep, 10);
   56|     42|		if (numstr == ep || *ep != '\0')
  ------------------
  |  Branch (56:7): [True: 0, False: 42]
  |  Branch (56:23): [True: 0, False: 42]
  ------------------
   57|      0|			error = INVALID;
  ------------------
  |  |   29|      0|#define INVALID		1
  ------------------
   58|     42|		else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval)
  ------------------
  |  Branch (58:13): [True: 0, False: 42]
  |  Branch (58:32): [True: 0, False: 0]
  |  Branch (58:52): [True: 0, False: 42]
  ------------------
   59|      0|			error = TOOSMALL;
  ------------------
  |  |   30|      0|#define TOOSMALL	2
  ------------------
   60|     42|		else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval)
  ------------------
  |  Branch (60:13): [True: 0, False: 42]
  |  Branch (60:32): [True: 0, False: 0]
  |  Branch (60:52): [True: 0, False: 42]
  ------------------
   61|      0|			error = TOOLARGE;
  ------------------
  |  |   31|      0|#define TOOLARGE	3
  ------------------
   62|     42|	}
   63|     42|	if (errstrp != NULL)
  ------------------
  |  Branch (63:6): [True: 42, False: 0]
  ------------------
   64|     42|		*errstrp = ev[error].errstr;
   65|     42|	errno = ev[error].err;
   66|     42|	if (error)
  ------------------
  |  Branch (66:6): [True: 0, False: 42]
  ------------------
   67|      0|		ll = 0;
   68|       |
   69|     42|	return (ll);
   70|     42|}

ssh_connection_hash:
  347|    798|{
  348|    798|	struct ssh_digest_ctx *md;
  349|    798|	u_char conn_hash[SSH_DIGEST_MAX_LENGTH];
  350|       |
  351|    798|	if ((md = ssh_digest_start(SSH_DIGEST_SHA1)) == NULL ||
  ------------------
  |  |   26|    798|#define SSH_DIGEST_SHA1		1
  ------------------
  |  Branch (351:6): [True: 0, False: 798]
  ------------------
  352|    798|	    ssh_digest_update(md, thishost, strlen(thishost)) < 0 ||
  ------------------
  |  Branch (352:6): [True: 0, False: 798]
  ------------------
  353|    798|	    ssh_digest_update(md, host, strlen(host)) < 0 ||
  ------------------
  |  Branch (353:6): [True: 0, False: 798]
  ------------------
  354|    798|	    ssh_digest_update(md, portstr, strlen(portstr)) < 0 ||
  ------------------
  |  Branch (354:6): [True: 0, False: 798]
  ------------------
  355|    798|	    ssh_digest_update(md, user, strlen(user)) < 0 ||
  ------------------
  |  Branch (355:6): [True: 0, False: 798]
  ------------------
  356|    798|	    ssh_digest_update(md, jumphost, strlen(jumphost)) < 0 ||
  ------------------
  |  Branch (356:6): [True: 0, False: 798]
  ------------------
  357|    798|	    ssh_digest_final(md, conn_hash, sizeof(conn_hash)) < 0)
  ------------------
  |  Branch (357:6): [True: 0, False: 798]
  ------------------
  358|      0|		fatal_f("mux digest failed");
  ------------------
  |  |  126|      0|#define fatal_f(...)		sshfatal(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
  359|    798|	ssh_digest_free(md);
  360|    798|	return tohex(conn_hash, ssh_digest_bytes(SSH_DIGEST_SHA1));
  ------------------
  |  |   26|    798|#define SSH_DIGEST_SHA1		1
  ------------------
  361|    798|}
add_remote_forward:
  399|      4|{
  400|      4|	struct Forward *fwd;
  401|      4|	int i;
  402|       |
  403|       |	/* Don't add duplicates */
  404|      4|	for (i = 0; i < options->num_remote_forwards; i++) {
  ------------------
  |  Branch (404:14): [True: 0, False: 4]
  ------------------
  405|      0|		if (forward_equals(newfwd, options->remote_forwards + i))
  ------------------
  |  Branch (405:7): [True: 0, False: 0]
  ------------------
  406|      0|			return;
  407|      0|	}
  408|      4|	options->remote_forwards = xreallocarray(options->remote_forwards,
  409|      4|	    options->num_remote_forwards + 1,
  410|      4|	    sizeof(*options->remote_forwards));
  411|      4|	fwd = &options->remote_forwards[options->num_remote_forwards++];
  412|       |
  413|      4|	fwd->listen_host = newfwd->listen_host;
  414|      4|	fwd->listen_port = newfwd->listen_port;
  415|      4|	fwd->listen_path = newfwd->listen_path;
  416|      4|	fwd->connect_host = newfwd->connect_host;
  417|      4|	fwd->connect_port = newfwd->connect_port;
  418|      4|	fwd->connect_path = newfwd->connect_path;
  419|      4|	fwd->handle = newfwd->handle;
  420|      4|	fwd->allocated_port = 0;
  421|      4|}
default_ssh_port:
  510|    789|{
  511|    789|	static int port;
  512|    789|	struct servent *sp;
  513|       |
  514|    789|	if (port == 0) {
  ------------------
  |  Branch (514:6): [True: 1, False: 788]
  ------------------
  515|      1|		sp = getservbyname(SSH_SERVICE_NAME, "tcp");
  ------------------
  |  |   46|      1|#define SSH_SERVICE_NAME	"ssh"
  ------------------
  516|      1|		port = sp ? ntohs(sp->s_port) : SSH_DEFAULT_PORT;
  ------------------
  |  |   16|      2|#define SSH_DEFAULT_PORT	22
  ------------------
  |  Branch (516:10): [True: 0, False: 1]
  ------------------
  517|      1|	}
  518|    789|	return port;
  519|    789|}
read_config_file:
 2622|    285|{
 2623|    285|	int active = 1;
 2624|       |
 2625|    285|	return read_config_file_depth(filename, pw, host, original_host,
 2626|    285|	    remote_command, options, flags, &active, want_final_pass, 0);
 2627|    285|}
option_clear_or_none:
 2688|    798|{
 2689|    798|	return o == NULL || strcasecmp(o, "none") == 0;
  ------------------
  |  Branch (2689:9): [True: 798, False: 0]
  |  Branch (2689:22): [True: 0, False: 0]
  ------------------
 2690|    798|}
initialize_options:
 2715|    285|{
 2716|    285|	memset(options, 'X', sizeof(*options));
 2717|    285|	options->host_arg = NULL;
 2718|    285|	options->forward_agent = -1;
 2719|    285|	options->forward_agent_sock_path = NULL;
 2720|    285|	options->forward_x11 = -1;
 2721|    285|	options->forward_x11_trusted = -1;
 2722|    285|	options->forward_x11_timeout = -1;
 2723|    285|	options->stdio_forward_host = NULL;
 2724|    285|	options->stdio_forward_port = 0;
 2725|    285|	options->clear_forwardings = -1;
 2726|    285|	options->exit_on_forward_failure = -1;
 2727|    285|	options->xauth_location = NULL;
 2728|    285|	options->fwd_opts.gateway_ports = -1;
 2729|    285|	options->fwd_opts.streamlocal_bind_mask = (mode_t)-1;
 2730|    285|	options->fwd_opts.streamlocal_bind_unlink = -1;
 2731|    285|	options->pubkey_authentication = -1;
 2732|    285|	options->gss_authentication = -1;
 2733|    285|	options->gss_deleg_creds = -1;
 2734|    285|	options->password_authentication = -1;
 2735|    285|	options->kbd_interactive_authentication = -1;
 2736|    285|	options->kbd_interactive_devices = NULL;
 2737|    285|	options->hostbased_authentication = -1;
 2738|    285|	options->batch_mode = -1;
 2739|    285|	options->check_host_ip = -1;
 2740|    285|	options->strict_host_key_checking = -1;
 2741|    285|	options->compression = -1;
 2742|    285|	options->tcp_keep_alive = -1;
 2743|    285|	options->port = -1;
 2744|    285|	options->address_family = -1;
 2745|    285|	options->connection_attempts = -1;
 2746|    285|	options->connection_timeout = -1;
 2747|    285|	options->number_of_password_prompts = -1;
 2748|    285|	options->ciphers = NULL;
 2749|    285|	options->macs = NULL;
 2750|    285|	options->kex_algorithms = NULL;
 2751|    285|	options->hostkeyalgorithms = NULL;
 2752|    285|	options->ca_sign_algorithms = NULL;
 2753|    285|	options->num_identity_files = 0;
 2754|    285|	memset(options->identity_keys, 0, sizeof(options->identity_keys));
 2755|    285|	options->num_certificate_files = 0;
 2756|    285|	memset(options->certificates, 0, sizeof(options->certificates));
 2757|    285|	options->hostname = NULL;
 2758|    285|	options->host_key_alias = NULL;
 2759|    285|	options->proxy_command = NULL;
 2760|    285|	options->jump_user = NULL;
 2761|    285|	options->jump_host = NULL;
 2762|    285|	options->jump_port = -1;
 2763|    285|	options->jump_extra = NULL;
 2764|    285|	options->user = NULL;
 2765|    285|	options->escape_char = -1;
 2766|    285|	options->num_system_hostfiles = 0;
 2767|    285|	options->num_user_hostfiles = 0;
 2768|    285|	options->local_forwards = NULL;
 2769|    285|	options->num_local_forwards = 0;
 2770|    285|	options->remote_forwards = NULL;
 2771|    285|	options->num_remote_forwards = 0;
 2772|    285|	options->permitted_remote_opens = NULL;
 2773|    285|	options->num_permitted_remote_opens = 0;
 2774|    285|	options->log_facility = SYSLOG_FACILITY_NOT_SET;
 2775|    285|	options->log_level = SYSLOG_LEVEL_NOT_SET;
 2776|    285|	options->num_log_verbose = 0;
 2777|    285|	options->log_verbose = NULL;
 2778|    285|	options->preferred_authentications = NULL;
 2779|    285|	options->bind_address = NULL;
 2780|    285|	options->bind_interface = NULL;
 2781|    285|	options->pkcs11_provider = NULL;
 2782|    285|	options->sk_provider = NULL;
 2783|    285|	options->enable_ssh_keysign = -1;
 2784|    285|	options->no_host_authentication_for_localhost = -1;
 2785|    285|	options->identities_only = -1;
 2786|    285|	options->rekey_limit = -1;
 2787|    285|	options->rekey_interval = -1;
 2788|    285|	options->verify_host_key_dns = -1;
 2789|    285|	options->server_alive_interval = -1;
 2790|    285|	options->server_alive_count_max = -1;
 2791|    285|	options->send_env = NULL;
 2792|    285|	options->num_send_env = 0;
 2793|    285|	options->setenv = NULL;
 2794|    285|	options->num_setenv = 0;
 2795|    285|	options->control_path = NULL;
 2796|    285|	options->control_master = -1;
 2797|    285|	options->control_persist = -1;
 2798|    285|	options->control_persist_timeout = 0;
 2799|    285|	options->hash_known_hosts = -1;
 2800|    285|	options->tun_open = -1;
 2801|    285|	options->tun_local = -1;
 2802|    285|	options->tun_remote = -1;
 2803|    285|	options->local_command = NULL;
 2804|    285|	options->permit_local_command = -1;
 2805|    285|	options->remote_command = NULL;
 2806|    285|	options->add_keys_to_agent = -1;
 2807|    285|	options->add_keys_to_agent_lifespan = -1;
 2808|    285|	options->identity_agent = NULL;
 2809|    285|	options->visual_host_key = -1;
 2810|    285|	options->ip_qos_interactive = -1;
 2811|    285|	options->ip_qos_bulk = -1;
 2812|    285|	options->request_tty = -1;
 2813|    285|	options->session_type = -1;
 2814|    285|	options->stdin_null = -1;
 2815|    285|	options->fork_after_authentication = -1;
 2816|    285|	options->proxy_use_fdpass = -1;
 2817|    285|	options->ignored_unknown = NULL;
 2818|    285|	options->num_canonical_domains = 0;
 2819|    285|	options->num_permitted_cnames = 0;
 2820|    285|	options->canonicalize_max_dots = -1;
 2821|    285|	options->canonicalize_fallback_local = -1;
 2822|    285|	options->canonicalize_hostname = -1;
 2823|    285|	options->revoked_host_keys = NULL;
 2824|    285|	options->num_revoked_host_keys = 0;
 2825|    285|	options->fingerprint_hash = -1;
 2826|    285|	options->update_hostkeys = -1;
 2827|    285|	options->hostbased_accepted_algos = NULL;
 2828|    285|	options->pubkey_accepted_algos = NULL;
 2829|    285|	options->known_hosts_command = NULL;
 2830|    285|	options->required_rsa_size = -1;
 2831|    285|	options->warn_weak_crypto = -1;
 2832|    285|	options->enable_escape_commandline = -1;
 2833|    285|	options->obscure_keystroke_timing_interval = -1;
 2834|    285|	options->tag = NULL;
 2835|    285|	options->channel_timeouts = NULL;
 2836|    285|	options->num_channel_timeouts = 0;
 2837|       |	options->version_addendum = NULL;
 2838|    285|}
parse_forward:
 3300|      4|{
 3301|      4|	struct fwdarg fwdargs[4];
 3302|      4|	char *p, *cp;
 3303|      4|	int i, err;
 3304|       |
 3305|      4|	memset(fwd, 0, sizeof(*fwd));
 3306|      4|	memset(fwdargs, 0, sizeof(fwdargs));
 3307|       |
 3308|       |	/*
 3309|       |	 * We expand environment variables before checking if we think they're
 3310|       |	 * paths so that if ${VAR} expands to a fully qualified path it is
 3311|       |	 * treated as a path.
 3312|       |	 */
 3313|      4|	cp = p = dollar_expand(&err, fwdspec);
 3314|      4|	if (p == NULL || err)
  ------------------
  |  Branch (3314:6): [True: 0, False: 4]
  |  Branch (3314:19): [True: 0, False: 4]
  ------------------
 3315|      0|		return 0;
 3316|       |
 3317|       |	/* skip leading spaces */
 3318|      4|	while (isspace((u_char)*cp))
  ------------------
  |  Branch (3318:9): [True: 42, False: 4]
  ------------------
 3319|     42|		cp++;
 3320|       |
 3321|     10|	for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (3321:14): [True: 10, False: 0]
  ------------------
 3322|     10|		if (parse_fwd_field(&cp, &fwdargs[i]) != 0)
  ------------------
  |  Branch (3322:7): [True: 4, False: 6]
  ------------------
 3323|      4|			break;
 3324|     10|	}
 3325|       |
 3326|       |	/* Check for trailing garbage */
 3327|      4|	if (cp != NULL && *cp != '\0') {
  ------------------
  |  Branch (3327:6): [True: 0, False: 4]
  |  Branch (3327:20): [True: 0, False: 0]
  ------------------
 3328|      0|		i = 0;	/* failure */
 3329|      0|	}
 3330|       |
 3331|      4|	switch (i) {
 3332|      2|	case 1:
  ------------------
  |  Branch (3332:2): [True: 2, False: 2]
  ------------------
 3333|      2|		if (fwdargs[0].ispath) {
  ------------------
  |  Branch (3333:7): [True: 2, False: 0]
  ------------------
 3334|      2|			fwd->listen_path = xstrdup(fwdargs[0].arg);
 3335|      2|			fwd->listen_port = PORT_STREAMLOCAL;
  ------------------
  |  |  162|      2|#define PORT_STREAMLOCAL	-2
  ------------------
 3336|      2|		} else {
 3337|      0|			fwd->listen_host = NULL;
 3338|      0|			fwd->listen_port = a2port(fwdargs[0].arg);
 3339|      0|		}
 3340|      2|		fwd->connect_host = xstrdup("socks");
 3341|      2|		break;
 3342|       |
 3343|      2|	case 2:
  ------------------
  |  Branch (3343:2): [True: 2, False: 2]
  ------------------
 3344|      2|		if (fwdargs[0].ispath && fwdargs[1].ispath) {
  ------------------
  |  Branch (3344:7): [True: 2, False: 0]
  |  Branch (3344:28): [True: 2, False: 0]
  ------------------
 3345|      2|			fwd->listen_path = xstrdup(fwdargs[0].arg);
 3346|      2|			fwd->listen_port = PORT_STREAMLOCAL;
  ------------------
  |  |  162|      2|#define PORT_STREAMLOCAL	-2
  ------------------
 3347|      2|			fwd->connect_path = xstrdup(fwdargs[1].arg);
 3348|      2|			fwd->connect_port = PORT_STREAMLOCAL;
  ------------------
  |  |  162|      2|#define PORT_STREAMLOCAL	-2
  ------------------
 3349|      2|		} else if (fwdargs[1].ispath) {
  ------------------
  |  Branch (3349:14): [True: 0, False: 0]
  ------------------
 3350|      0|			fwd->listen_host = NULL;
 3351|      0|			fwd->listen_port = a2port(fwdargs[0].arg);
 3352|      0|			fwd->connect_path = xstrdup(fwdargs[1].arg);
 3353|      0|			fwd->connect_port = PORT_STREAMLOCAL;
  ------------------
  |  |  162|      0|#define PORT_STREAMLOCAL	-2
  ------------------
 3354|      0|		} else {
 3355|      0|			fwd->listen_host = xstrdup(fwdargs[0].arg);
 3356|      0|			fwd->listen_port = a2port(fwdargs[1].arg);
 3357|      0|			fwd->connect_host = xstrdup("socks");
 3358|      0|		}
 3359|      2|		break;
 3360|       |
 3361|      0|	case 3:
  ------------------
  |  Branch (3361:2): [True: 0, False: 4]
  ------------------
 3362|      0|		if (fwdargs[0].ispath) {
  ------------------
  |  Branch (3362:7): [True: 0, False: 0]
  ------------------
 3363|      0|			fwd->listen_path = xstrdup(fwdargs[0].arg);
 3364|      0|			fwd->listen_port = PORT_STREAMLOCAL;
  ------------------
  |  |  162|      0|#define PORT_STREAMLOCAL	-2
  ------------------
 3365|      0|			fwd->connect_host = xstrdup(fwdargs[1].arg);
 3366|      0|			fwd->connect_port = a2port(fwdargs[2].arg);
 3367|      0|		} else if (fwdargs[2].ispath) {
  ------------------
  |  Branch (3367:14): [True: 0, False: 0]
  ------------------
 3368|      0|			fwd->listen_host = xstrdup(fwdargs[0].arg);
 3369|      0|			fwd->listen_port = a2port(fwdargs[1].arg);
 3370|      0|			fwd->connect_path = xstrdup(fwdargs[2].arg);
 3371|      0|			fwd->connect_port = PORT_STREAMLOCAL;
  ------------------
  |  |  162|      0|#define PORT_STREAMLOCAL	-2
  ------------------
 3372|      0|		} else {
 3373|      0|			fwd->listen_host = NULL;
 3374|      0|			fwd->listen_port = a2port(fwdargs[0].arg);
 3375|      0|			fwd->connect_host = xstrdup(fwdargs[1].arg);
 3376|      0|			fwd->connect_port = a2port(fwdargs[2].arg);
 3377|      0|		}
 3378|      0|		break;
 3379|       |
 3380|      0|	case 4:
  ------------------
  |  Branch (3380:2): [True: 0, False: 4]
  ------------------
 3381|      0|		fwd->listen_host = xstrdup(fwdargs[0].arg);
 3382|      0|		fwd->listen_port = a2port(fwdargs[1].arg);
 3383|      0|		fwd->connect_host = xstrdup(fwdargs[2].arg);
 3384|      0|		fwd->connect_port = a2port(fwdargs[3].arg);
 3385|      0|		break;
 3386|      0|	default:
  ------------------
  |  Branch (3386:2): [True: 0, False: 4]
  ------------------
 3387|      0|		i = 0; /* failure */
 3388|      4|	}
 3389|       |
 3390|      4|	free(p);
 3391|       |
 3392|      4|	if (dynamicfwd) {
  ------------------
  |  Branch (3392:6): [True: 2, False: 2]
  ------------------
 3393|      2|		if (!(i == 1 || i == 2))
  ------------------
  |  Branch (3393:9): [True: 2, False: 0]
  |  Branch (3393:19): [True: 0, False: 0]
  ------------------
 3394|      0|			goto fail_free;
 3395|      2|	} else {
 3396|      2|		if (!(i == 3 || i == 4)) {
  ------------------
  |  Branch (3396:9): [True: 0, False: 2]
  |  Branch (3396:19): [True: 0, False: 2]
  ------------------
 3397|      2|			if (fwd->connect_path == NULL &&
  ------------------
  |  Branch (3397:8): [True: 0, False: 2]
  ------------------
 3398|      0|			    fwd->listen_path == NULL)
  ------------------
  |  Branch (3398:8): [True: 0, False: 0]
  ------------------
 3399|      0|				goto fail_free;
 3400|      2|		}
 3401|      2|		if (fwd->connect_port <= 0 && fwd->connect_path == NULL)
  ------------------
  |  Branch (3401:7): [True: 2, False: 0]
  |  Branch (3401:33): [True: 0, False: 2]
  ------------------
 3402|      0|			goto fail_free;
 3403|      2|	}
 3404|       |
 3405|      4|	if ((fwd->listen_port < 0 && fwd->listen_path == NULL) ||
  ------------------
  |  Branch (3405:7): [True: 4, False: 0]
  |  Branch (3405:31): [True: 0, False: 4]
  ------------------
 3406|      4|	    (!remotefwd && fwd->listen_port == 0))
  ------------------
  |  Branch (3406:7): [True: 0, False: 4]
  |  Branch (3406:21): [True: 0, False: 0]
  ------------------
 3407|      0|		goto fail_free;
 3408|      4|	if (fwd->connect_host != NULL &&
  ------------------
  |  Branch (3408:6): [True: 2, False: 2]
  ------------------
 3409|      2|	    strlen(fwd->connect_host) >= NI_MAXHOST)
  ------------------
  |  Branch (3409:6): [True: 0, False: 2]
  ------------------
 3410|      0|		goto fail_free;
 3411|       |	/*
 3412|       |	 * XXX - if connecting to a remote socket, max sun len may not
 3413|       |	 * match this host
 3414|       |	 */
 3415|      4|	if (fwd->connect_path != NULL &&
  ------------------
  |  Branch (3415:6): [True: 2, False: 2]
  ------------------
 3416|      2|	    strlen(fwd->connect_path) >= PATH_MAX_SUN)
  ------------------
  |  |   22|      2|#define PATH_MAX_SUN		(sizeof((struct sockaddr_un *)0)->sun_path)
  ------------------
  |  Branch (3416:6): [True: 0, False: 2]
  ------------------
 3417|      0|		goto fail_free;
 3418|      4|	if (fwd->listen_host != NULL &&
  ------------------
  |  Branch (3418:6): [True: 0, False: 4]
  ------------------
 3419|      0|	    strlen(fwd->listen_host) >= NI_MAXHOST)
  ------------------
  |  Branch (3419:6): [True: 0, False: 0]
  ------------------
 3420|      0|		goto fail_free;
 3421|      4|	if (fwd->listen_path != NULL &&
  ------------------
  |  Branch (3421:6): [True: 4, False: 0]
  ------------------
 3422|      4|	    strlen(fwd->listen_path) >= PATH_MAX_SUN)
  ------------------
  |  |   22|      4|#define PATH_MAX_SUN		(sizeof((struct sockaddr_un *)0)->sun_path)
  ------------------
  |  Branch (3422:6): [True: 0, False: 4]
  ------------------
 3423|      0|		goto fail_free;
 3424|       |
 3425|      4|	return (i);
 3426|       |
 3427|      0| fail_free:
 3428|      0|	free(fwd->connect_host);
 3429|      0|	fwd->connect_host = NULL;
 3430|      0|	free(fwd->connect_path);
 3431|      0|	fwd->connect_path = NULL;
 3432|      0|	free(fwd->listen_host);
 3433|      0|	fwd->listen_host = NULL;
 3434|      0|	free(fwd->listen_path);
 3435|       |	fwd->listen_path = NULL;
 3436|      0|	return (0);
 3437|      4|}
readconf.c:process_config_line_depth:
 1147|  1.49k|{
 1148|  1.49k|	char *str, **charptr, *endofnumber, *keyword, *arg, *arg2, *p;
 1149|  1.49k|	char **cpptr, ***cppptr, fwdarg[256];
 1150|  1.49k|	u_int i, *uintptr, max_entries = 0;
 1151|  1.49k|	int r, oactive, negated, opcode, *intptr, value, value2, cmdline = 0;
 1152|  1.49k|	int remotefwd, dynamicfwd, ca_only = 0, found = 0;
 1153|  1.49k|	LogLevel *log_level_ptr;
 1154|  1.49k|	SyslogFacility *log_facility_ptr;
 1155|  1.49k|	long long val64;
 1156|  1.49k|	size_t len;
 1157|  1.49k|	struct Forward fwd;
 1158|  1.49k|	const struct multistate *multistate_ptr;
 1159|  1.49k|	glob_t gl;
  ------------------
  |  |   51|  1.49k|# define glob_t _ssh_compat_glob_t
  ------------------
 1160|  1.49k|	const char *errstr;
 1161|  1.49k|	char **oav = NULL, **av;
 1162|  1.49k|	int oac = 0, ac;
 1163|  1.49k|	int ret = -1;
 1164|  1.49k|	struct allowed_cname *cnames = NULL;
 1165|  1.49k|	u_int ncnames = 0;
 1166|  1.49k|	char **strs = NULL; /* string array arguments; freed implicitly */
 1167|  1.49k|	u_int nstrs = 0;
 1168|       |
 1169|  1.49k|	if (activep == NULL) { /* We are processing a command line directive */
  ------------------
  |  Branch (1169:6): [True: 0, False: 1.49k]
  ------------------
 1170|      0|		cmdline = 1;
 1171|      0|		activep = &cmdline;
 1172|      0|	}
 1173|       |
 1174|       |	/* Strip trailing whitespace. Allow \f (form feed) at EOL only */
 1175|  1.49k|	if ((len = strlen(line)) == 0)
  ------------------
  |  Branch (1175:6): [True: 213, False: 1.27k]
  ------------------
 1176|    213|		return 0;
 1177|  2.64k|	for (len--; len > 0; len--) {
  ------------------
  |  Branch (1177:14): [True: 1.89k, False: 747]
  ------------------
 1178|  1.89k|		if (strchr(WHITESPACE "\f", line[len]) == NULL)
  ------------------
  |  | 1141|  1.89k|#define WHITESPACE " \t\r\n"
  ------------------
  |  Branch (1178:7): [True: 531, False: 1.36k]
  ------------------
 1179|    531|			break;
 1180|  1.36k|		line[len] = '\0';
 1181|  1.36k|	}
 1182|       |
 1183|  1.27k|	str = line;
 1184|       |	/* Get the keyword. (Each line is supposed to begin with a keyword). */
 1185|  1.27k|	if ((keyword = strdelim(&str)) == NULL)
  ------------------
  |  Branch (1185:6): [True: 84, False: 1.19k]
  ------------------
 1186|     84|		return 0;
 1187|       |	/* Ignore leading whitespace. */
 1188|  1.19k|	if (*keyword == '\0')
  ------------------
  |  Branch (1188:6): [True: 978, False: 216]
  ------------------
 1189|    978|		keyword = strdelim(&str);
 1190|  1.19k|	if (keyword == NULL || !*keyword || *keyword == '\n' || *keyword == '#')
  ------------------
  |  Branch (1190:6): [True: 3, False: 1.19k]
  |  Branch (1190:25): [True: 748, False: 443]
  |  Branch (1190:38): [True: 0, False: 443]
  |  Branch (1190:58): [True: 19, False: 424]
  ------------------
 1191|    770|		return 0;
 1192|       |	/* Match lowercase keyword */
 1193|    424|	lowercase(keyword);
 1194|       |
 1195|       |	/* Prepare to parse remainder of line */
 1196|    424|	if (str != NULL)
  ------------------
  |  Branch (1196:6): [True: 424, False: 0]
  ------------------
 1197|    424|		str += strspn(str, WHITESPACE);
  ------------------
  |  | 1141|    424|#define WHITESPACE " \t\r\n"
  ------------------
 1198|    424|	if (str == NULL || *str == '\0') {
  ------------------
  |  Branch (1198:6): [True: 0, False: 424]
  |  Branch (1198:21): [True: 0, False: 424]
  ------------------
 1199|      0|		error("%s line %d: no argument after keyword \"%s\"",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1200|      0|		    filename, linenum, keyword);
 1201|      0|		return -1;
 1202|      0|	}
 1203|    424|	opcode = parse_token(keyword, filename, linenum,
 1204|    424|	    options->ignored_unknown);
 1205|    424|	if (argv_split(str, &oac, &oav, 1) != 0) {
  ------------------
  |  Branch (1205:6): [True: 0, False: 424]
  ------------------
 1206|      0|		error("%s line %d: invalid quotes", filename, linenum);
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1207|      0|		return -1;
 1208|      0|	}
 1209|    424|	ac = oac;
 1210|    424|	av = oav;
 1211|       |
 1212|    424|	switch (opcode) {
 1213|      0|	case oBadOption:
  ------------------
  |  Branch (1213:2): [True: 0, False: 424]
  ------------------
 1214|       |		/* don't panic, but count bad options */
 1215|      0|		goto out;
 1216|     16|	case oIgnore:
  ------------------
  |  Branch (1216:2): [True: 16, False: 408]
  ------------------
 1217|     16|		argv_consume(&ac);
 1218|     16|		break;
 1219|      0|	case oIgnoredUnknownOption:
  ------------------
  |  Branch (1219:2): [True: 0, False: 424]
  ------------------
 1220|      0|		debug("%s line %d: Ignored unknown option \"%s\"",
  ------------------
  |  |  111|      0|#define debug(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG1, NULL, __VA_ARGS__)
  ------------------
 1221|      0|		    filename, linenum, keyword);
 1222|      0|		argv_consume(&ac);
 1223|      0|		break;
 1224|      0|	case oConnectTimeout:
  ------------------
  |  Branch (1224:2): [True: 0, False: 424]
  ------------------
 1225|      0|		intptr = &options->connection_timeout;
 1226|     23|parse_time:
 1227|     23|		arg = argv_next(&ac, &av);
 1228|     23|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1228:7): [True: 0, False: 23]
  |  Branch (1228:15): [True: 0, False: 23]
  ------------------
 1229|      0|			error("%s line %d: missing time value.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1230|      0|			    filename, linenum);
 1231|      0|			goto out;
 1232|      0|		}
 1233|     23|		if (strcmp(arg, "none") == 0)
  ------------------
  |  Branch (1233:7): [True: 0, False: 23]
  ------------------
 1234|      0|			value = -1;
 1235|     23|		else if ((value = convtime(arg)) == -1) {
  ------------------
  |  Branch (1235:12): [True: 0, False: 23]
  ------------------
 1236|      0|			error("%s line %d: invalid time value.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1237|      0|			    filename, linenum);
 1238|      0|			goto out;
 1239|      0|		}
 1240|     23|		if (*activep && *intptr == -1)
  ------------------
  |  Branch (1240:7): [True: 21, False: 2]
  |  Branch (1240:19): [True: 12, False: 9]
  ------------------
 1241|     12|			*intptr = value;
 1242|     23|		break;
 1243|       |
 1244|      0|	case oForwardAgent:
  ------------------
  |  Branch (1244:2): [True: 0, False: 424]
  ------------------
 1245|      0|		intptr = &options->forward_agent;
 1246|       |
 1247|      0|		arg = argv_next(&ac, &av);
 1248|      0|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1248:7): [True: 0, False: 0]
  |  Branch (1248:15): [True: 0, False: 0]
  ------------------
 1249|      0|			error("%s line %d: missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1250|      0|			    filename, linenum);
 1251|      0|			goto out;
 1252|      0|		}
 1253|       |
 1254|      0|		value = -1;
 1255|      0|		multistate_ptr = multistate_flag;
 1256|      0|		for (i = 0; multistate_ptr[i].key != NULL; i++) {
  ------------------
  |  Branch (1256:15): [True: 0, False: 0]
  ------------------
 1257|      0|			if (strcasecmp(arg, multistate_ptr[i].key) == 0) {
  ------------------
  |  Branch (1257:8): [True: 0, False: 0]
  ------------------
 1258|      0|				value = multistate_ptr[i].value;
 1259|      0|				break;
 1260|      0|			}
 1261|      0|		}
 1262|      0|		if (value != -1) {
  ------------------
  |  Branch (1262:7): [True: 0, False: 0]
  ------------------
 1263|      0|			if (*activep && *intptr == -1)
  ------------------
  |  Branch (1263:8): [True: 0, False: 0]
  |  Branch (1263:20): [True: 0, False: 0]
  ------------------
 1264|      0|				*intptr = value;
 1265|      0|			break;
 1266|      0|		}
 1267|       |		/* ForwardAgent wasn't 'yes' or 'no', assume a path */
 1268|      0|		if (*activep && *intptr == -1)
  ------------------
  |  Branch (1268:7): [True: 0, False: 0]
  |  Branch (1268:19): [True: 0, False: 0]
  ------------------
 1269|      0|			*intptr = 1;
 1270|       |
 1271|      0|		charptr = &options->forward_agent_sock_path;
 1272|      0|		goto parse_agent_path;
 1273|       |
 1274|      0|	case oForwardX11:
  ------------------
  |  Branch (1274:2): [True: 0, False: 424]
  ------------------
 1275|      0|		intptr = &options->forward_x11;
 1276|      0| parse_flag:
 1277|      0|		multistate_ptr = multistate_flag;
 1278|      0| parse_multistate:
 1279|      0|		arg = argv_next(&ac, &av);
 1280|      0|		if ((value = parse_multistate_value(arg, filename, linenum,
  ------------------
  |  Branch (1280:7): [True: 0, False: 0]
  ------------------
 1281|      0|		    multistate_ptr)) == -1) {
 1282|      0|			error("%s line %d: unsupported option \"%s\".",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1283|      0|			    filename, linenum, arg);
 1284|      0|			goto out;
 1285|      0|		}
 1286|      0|		if (*activep && *intptr == -1)
  ------------------
  |  Branch (1286:7): [True: 0, False: 0]
  |  Branch (1286:19): [True: 0, False: 0]
  ------------------
 1287|      0|			*intptr = value;
 1288|      0|		break;
 1289|       |
 1290|      0|	case oForwardX11Trusted:
  ------------------
  |  Branch (1290:2): [True: 0, False: 424]
  ------------------
 1291|      0|		intptr = &options->forward_x11_trusted;
 1292|      0|		goto parse_flag;
 1293|       |
 1294|      0|	case oForwardX11Timeout:
  ------------------
  |  Branch (1294:2): [True: 0, False: 424]
  ------------------
 1295|      0|		intptr = &options->forward_x11_timeout;
 1296|      0|		goto parse_time;
 1297|       |
 1298|      0|	case oGatewayPorts:
  ------------------
  |  Branch (1298:2): [True: 0, False: 424]
  ------------------
 1299|      0|		intptr = &options->fwd_opts.gateway_ports;
 1300|      0|		goto parse_flag;
 1301|       |
 1302|      0|	case oExitOnForwardFailure:
  ------------------
  |  Branch (1302:2): [True: 0, False: 424]
  ------------------
 1303|      0|		intptr = &options->exit_on_forward_failure;
 1304|      0|		goto parse_flag;
 1305|       |
 1306|      0|	case oPasswordAuthentication:
  ------------------
  |  Branch (1306:2): [True: 0, False: 424]
  ------------------
 1307|      0|		intptr = &options->password_authentication;
 1308|      0|		goto parse_flag;
 1309|       |
 1310|      0|	case oKbdInteractiveAuthentication:
  ------------------
  |  Branch (1310:2): [True: 0, False: 424]
  ------------------
 1311|      0|		intptr = &options->kbd_interactive_authentication;
 1312|      0|		goto parse_flag;
 1313|       |
 1314|      0|	case oKbdInteractiveDevices:
  ------------------
  |  Branch (1314:2): [True: 0, False: 424]
  ------------------
 1315|      0|		charptr = &options->kbd_interactive_devices;
 1316|      0|		goto parse_string;
 1317|       |
 1318|      0|	case oPubkeyAuthentication:
  ------------------
  |  Branch (1318:2): [True: 0, False: 424]
  ------------------
 1319|      0|		multistate_ptr = multistate_pubkey_auth;
 1320|      0|		intptr = &options->pubkey_authentication;
 1321|      0|		goto parse_multistate;
 1322|       |
 1323|      0|	case oHostbasedAuthentication:
  ------------------
  |  Branch (1323:2): [True: 0, False: 424]
  ------------------
 1324|      0|		intptr = &options->hostbased_authentication;
 1325|      0|		goto parse_flag;
 1326|       |
 1327|      0|	case oGssAuthentication:
  ------------------
  |  Branch (1327:2): [True: 0, False: 424]
  ------------------
 1328|      0|		intptr = &options->gss_authentication;
 1329|      0|		goto parse_flag;
 1330|       |
 1331|      0|	case oGssDelegateCreds:
  ------------------
  |  Branch (1331:2): [True: 0, False: 424]
  ------------------
 1332|      0|		intptr = &options->gss_deleg_creds;
 1333|      0|		goto parse_flag;
 1334|       |
 1335|      0|	case oBatchMode:
  ------------------
  |  Branch (1335:2): [True: 0, False: 424]
  ------------------
 1336|      0|		intptr = &options->batch_mode;
 1337|      0|		goto parse_flag;
 1338|       |
 1339|      0|	case oCheckHostIP:
  ------------------
  |  Branch (1339:2): [True: 0, False: 424]
  ------------------
 1340|      0|		intptr = &options->check_host_ip;
 1341|      0|		goto parse_flag;
 1342|       |
 1343|      0|	case oVerifyHostKeyDNS:
  ------------------
  |  Branch (1343:2): [True: 0, False: 424]
  ------------------
 1344|      0|		intptr = &options->verify_host_key_dns;
 1345|      0|		multistate_ptr = multistate_yesnoask;
 1346|      0|		goto parse_multistate;
 1347|       |
 1348|      0|	case oStrictHostKeyChecking:
  ------------------
  |  Branch (1348:2): [True: 0, False: 424]
  ------------------
 1349|      0|		intptr = &options->strict_host_key_checking;
 1350|      0|		multistate_ptr = multistate_strict_hostkey;
 1351|      0|		goto parse_multistate;
 1352|       |
 1353|      0|	case oCompression:
  ------------------
  |  Branch (1353:2): [True: 0, False: 424]
  ------------------
 1354|      0|		intptr = &options->compression;
 1355|      0|		multistate_ptr = multistate_compression;
 1356|      0|		goto parse_multistate;
 1357|       |
 1358|      0|	case oTCPKeepAlive:
  ------------------
  |  Branch (1358:2): [True: 0, False: 424]
  ------------------
 1359|      0|		intptr = &options->tcp_keep_alive;
 1360|      0|		multistate_ptr = multistate_keepalives;
 1361|      0|		goto parse_multistate;
 1362|       |
 1363|      0|	case oNoHostAuthenticationForLocalhost:
  ------------------
  |  Branch (1363:2): [True: 0, False: 424]
  ------------------
 1364|      0|		intptr = &options->no_host_authentication_for_localhost;
 1365|      0|		goto parse_flag;
 1366|       |
 1367|      0|	case oNumberOfPasswordPrompts:
  ------------------
  |  Branch (1367:2): [True: 0, False: 424]
  ------------------
 1368|      0|		intptr = &options->number_of_password_prompts;
 1369|      0|		goto parse_int;
 1370|       |
 1371|     35|	case oRekeyLimit:
  ------------------
  |  Branch (1371:2): [True: 35, False: 389]
  ------------------
 1372|     35|		arg = argv_next(&ac, &av);
 1373|     35|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1373:7): [True: 0, False: 35]
  |  Branch (1373:15): [True: 0, False: 35]
  ------------------
 1374|      0|			error("%.200s line %d: Missing argument.", filename,
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1375|      0|			    linenum);
 1376|      0|			goto out;
 1377|      0|		}
 1378|     35|		if (strcmp(arg, "default") == 0) {
  ------------------
  |  Branch (1378:7): [True: 0, False: 35]
  ------------------
 1379|      0|			val64 = 0;
 1380|     35|		} else {
 1381|     35|			if (scan_scaled(arg, &val64) == -1) {
  ------------------
  |  Branch (1381:8): [True: 0, False: 35]
  ------------------
 1382|      0|				error("%.200s line %d: Bad number '%s': %s",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1383|      0|				    filename, linenum, arg, strerror(errno));
 1384|      0|				goto out;
 1385|      0|			}
 1386|     35|			if (val64 != 0 && val64 < 16) {
  ------------------
  |  Branch (1386:8): [True: 28, False: 7]
  |  Branch (1386:22): [True: 0, False: 28]
  ------------------
 1387|      0|				error("%.200s line %d: RekeyLimit too small",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1388|      0|				    filename, linenum);
 1389|      0|				goto out;
 1390|      0|			}
 1391|     35|		}
 1392|     35|		if (*activep && options->rekey_limit == -1)
  ------------------
  |  Branch (1392:7): [True: 32, False: 3]
  |  Branch (1392:19): [True: 19, False: 13]
  ------------------
 1393|     19|			options->rekey_limit = val64;
 1394|     35|		if (ac != 0) { /* optional rekey interval present */
  ------------------
  |  Branch (1394:7): [True: 23, False: 12]
  ------------------
 1395|     23|			if (strcmp(av[0], "none") == 0) {
  ------------------
  |  Branch (1395:8): [True: 0, False: 23]
  ------------------
 1396|      0|				(void)argv_next(&ac, &av);	/* discard */
 1397|      0|				break;
 1398|      0|			}
 1399|     23|			intptr = &options->rekey_interval;
 1400|     23|			goto parse_time;
 1401|     23|		}
 1402|     12|		break;
 1403|       |
 1404|     12|	case oIdentityFile:
  ------------------
  |  Branch (1404:2): [True: 0, False: 424]
  ------------------
 1405|      0|		arg = argv_next(&ac, &av);
 1406|      0|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1406:7): [True: 0, False: 0]
  |  Branch (1406:15): [True: 0, False: 0]
  ------------------
 1407|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1408|      0|			    filename, linenum);
 1409|      0|			goto out;
 1410|      0|		}
 1411|      0|		if (*activep) {
  ------------------
  |  Branch (1411:7): [True: 0, False: 0]
  ------------------
 1412|      0|			intptr = &options->num_identity_files;
 1413|      0|			if (*intptr >= SSH_MAX_IDENTITY_FILES) {
  ------------------
  |  |   28|      0|#define SSH_MAX_IDENTITY_FILES		100
  ------------------
  |  Branch (1413:8): [True: 0, False: 0]
  ------------------
 1414|      0|				error("%.200s line %d: Too many identity files "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1415|      0|				    "specified (max %d).", filename, linenum,
 1416|      0|				    SSH_MAX_IDENTITY_FILES);
 1417|      0|				goto out;
 1418|      0|			}
 1419|      0|			add_identity_file(options, NULL,
 1420|      0|			    arg, flags & SSHCONF_USERCONF);
  ------------------
  |  |  220|      0|#define SSHCONF_USERCONF	2  /* user provided config file not system */
  ------------------
 1421|      0|		}
 1422|      0|		break;
 1423|       |
 1424|      0|	case oCertificateFile:
  ------------------
  |  Branch (1424:2): [True: 0, False: 424]
  ------------------
 1425|      0|		arg = argv_next(&ac, &av);
 1426|      0|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1426:7): [True: 0, False: 0]
  |  Branch (1426:15): [True: 0, False: 0]
  ------------------
 1427|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1428|      0|			    filename, linenum);
 1429|      0|			goto out;
 1430|      0|		}
 1431|      0|		if (*activep) {
  ------------------
  |  Branch (1431:7): [True: 0, False: 0]
  ------------------
 1432|      0|			intptr = &options->num_certificate_files;
 1433|      0|			if (*intptr >= SSH_MAX_CERTIFICATE_FILES) {
  ------------------
  |  |   22|      0|#define SSH_MAX_CERTIFICATE_FILES	100
  ------------------
  |  Branch (1433:8): [True: 0, False: 0]
  ------------------
 1434|      0|				error("%.200s line %d: Too many certificate "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1435|      0|				    "files specified (max %d).",
 1436|      0|				    filename, linenum,
 1437|      0|				    SSH_MAX_CERTIFICATE_FILES);
 1438|      0|				goto out;
 1439|      0|			}
 1440|      0|			add_certificate_file(options, arg,
 1441|      0|			    flags & SSHCONF_USERCONF);
  ------------------
  |  |  220|      0|#define SSHCONF_USERCONF	2  /* user provided config file not system */
  ------------------
 1442|      0|		}
 1443|      0|		break;
 1444|       |
 1445|      0|	case oXAuthLocation:
  ------------------
  |  Branch (1445:2): [True: 0, False: 424]
  ------------------
 1446|      0|		charptr=&options->xauth_location;
 1447|      0|		goto parse_string;
 1448|       |
 1449|      9|	case oUser:
  ------------------
  |  Branch (1449:2): [True: 9, False: 415]
  ------------------
 1450|      9|		charptr = &options->user;
 1451|     34|parse_string:
 1452|     34|		arg = argv_next(&ac, &av);
 1453|     34|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1453:7): [True: 0, False: 34]
  |  Branch (1453:15): [True: 0, False: 34]
  ------------------
 1454|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1455|      0|			    filename, linenum);
 1456|      0|			goto out;
 1457|      0|		}
 1458|     34|		if (*activep && *charptr == NULL)
  ------------------
  |  Branch (1458:7): [True: 30, False: 4]
  |  Branch (1458:19): [True: 20, False: 10]
  ------------------
 1459|     20|			*charptr = xstrdup(arg);
 1460|     34|		break;
 1461|       |
 1462|      0|	case oGlobalKnownHostsFile:
  ------------------
  |  Branch (1462:2): [True: 0, False: 424]
  ------------------
 1463|      0|		cpptr = (char **)&options->system_hostfiles;
 1464|      0|		uintptr = &options->num_system_hostfiles;
 1465|      0|		max_entries = SSH_MAX_HOSTS_FILES;
  ------------------
  |  |   21|      0|#define SSH_MAX_HOSTS_FILES	32
  ------------------
 1466|      6|parse_char_array:
 1467|      6|		i = 0;
 1468|      6|		value = *uintptr == 0; /* was array empty when we started? */
 1469|     40|		while ((arg = argv_next(&ac, &av)) != NULL) {
  ------------------
  |  Branch (1469:10): [True: 34, False: 6]
  ------------------
 1470|     34|			if (*arg == '\0') {
  ------------------
  |  Branch (1470:8): [True: 0, False: 34]
  ------------------
 1471|      0|				error("%s line %d: keyword %s empty argument",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1472|      0|				    filename, linenum, keyword);
 1473|      0|				goto out;
 1474|      0|			}
 1475|       |			/* Allow "none" only in first position */
 1476|     34|			if (strcasecmp(arg, "none") == 0) {
  ------------------
  |  Branch (1476:8): [True: 0, False: 34]
  ------------------
 1477|      0|				if (i > 0 || ac > 0) {
  ------------------
  |  Branch (1477:9): [True: 0, False: 0]
  |  Branch (1477:18): [True: 0, False: 0]
  ------------------
 1478|      0|					error("%s line %d: keyword %s \"none\" "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1479|      0|					    "argument must appear alone.",
 1480|      0|					    filename, linenum, keyword);
 1481|      0|					goto out;
 1482|      0|				}
 1483|      0|			}
 1484|     34|			i++;
 1485|     34|			if (*activep && value) {
  ------------------
  |  Branch (1485:8): [True: 26, False: 8]
  |  Branch (1485:20): [True: 25, False: 1]
  ------------------
 1486|     25|				if ((*uintptr) >= max_entries) {
  ------------------
  |  Branch (1486:9): [True: 0, False: 25]
  ------------------
 1487|      0|					error("%s line %d: too many %s "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1488|      0|					    "entries.", filename, linenum,
 1489|      0|					    keyword);
 1490|      0|					goto out;
 1491|      0|				}
 1492|     25|				cpptr[(*uintptr)++] = xstrdup(arg);
 1493|     25|			}
 1494|     34|		}
 1495|      6|		break;
 1496|       |
 1497|      6|	case oUserKnownHostsFile:
  ------------------
  |  Branch (1497:2): [True: 6, False: 418]
  ------------------
 1498|      6|		cpptr = (char **)&options->user_hostfiles;
 1499|      6|		uintptr = &options->num_user_hostfiles;
 1500|      6|		max_entries = SSH_MAX_HOSTS_FILES;
  ------------------
  |  |   21|      6|#define SSH_MAX_HOSTS_FILES	32
  ------------------
 1501|      6|		goto parse_char_array;
 1502|       |
 1503|      0|	case oHostname:
  ------------------
  |  Branch (1503:2): [True: 0, False: 424]
  ------------------
 1504|      0|		charptr = &options->hostname;
 1505|      0|		goto parse_string;
 1506|       |
 1507|     14|	case oTag:
  ------------------
  |  Branch (1507:2): [True: 14, False: 410]
  ------------------
 1508|     14|		charptr = &options->tag;
 1509|     14|		goto parse_string;
 1510|       |
 1511|      4|	case oHostKeyAlias:
  ------------------
  |  Branch (1511:2): [True: 4, False: 420]
  ------------------
 1512|      4|		charptr = &options->host_key_alias;
 1513|      4|		goto parse_string;
 1514|       |
 1515|      0|	case oPreferredAuthentications:
  ------------------
  |  Branch (1515:2): [True: 0, False: 424]
  ------------------
 1516|      0|		charptr = &options->preferred_authentications;
 1517|      0|		goto parse_string;
 1518|       |
 1519|      0|	case oBindAddress:
  ------------------
  |  Branch (1519:2): [True: 0, False: 424]
  ------------------
 1520|      0|		charptr = &options->bind_address;
 1521|      0|		goto parse_string;
 1522|       |
 1523|      0|	case oBindInterface:
  ------------------
  |  Branch (1523:2): [True: 0, False: 424]
  ------------------
 1524|      0|		charptr = &options->bind_interface;
 1525|      0|		goto parse_string;
 1526|       |
 1527|      0|	case oPKCS11Provider:
  ------------------
  |  Branch (1527:2): [True: 0, False: 424]
  ------------------
 1528|      0|		charptr = &options->pkcs11_provider;
 1529|      0|		goto parse_string;
 1530|       |
 1531|      6|	case oSecurityKeyProvider:
  ------------------
  |  Branch (1531:2): [True: 6, False: 418]
  ------------------
 1532|      6|		charptr = &options->sk_provider;
 1533|      6|		goto parse_string;
 1534|       |
 1535|      0|	case oKnownHostsCommand:
  ------------------
  |  Branch (1535:2): [True: 0, False: 424]
  ------------------
 1536|      0|		charptr = &options->known_hosts_command;
 1537|      0|		goto parse_command;
 1538|       |
 1539|      9|	case oProxyCommand:
  ------------------
  |  Branch (1539:2): [True: 9, False: 415]
  ------------------
 1540|      9|		charptr = &options->proxy_command;
 1541|      9|parse_command:
 1542|      9|		if (str == NULL) {
  ------------------
  |  Branch (1542:7): [True: 0, False: 9]
  ------------------
 1543|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1544|      0|			    filename, linenum);
 1545|      0|			goto out;
 1546|      0|		}
 1547|      9|		len = strspn(str, WHITESPACE "=");
  ------------------
  |  | 1141|      9|#define WHITESPACE " \t\r\n"
  ------------------
 1548|      9|		if (*activep && *charptr == NULL)
  ------------------
  |  Branch (1548:7): [True: 9, False: 0]
  |  Branch (1548:19): [True: 6, False: 3]
  ------------------
 1549|      6|			*charptr = xstrdup(str + len);
 1550|      9|		argv_consume(&ac);
 1551|      9|		break;
 1552|       |
 1553|      0|	case oProxyJump:
  ------------------
  |  Branch (1553:2): [True: 0, False: 424]
  ------------------
 1554|      0|		if (str == NULL) {
  ------------------
  |  Branch (1554:7): [True: 0, False: 0]
  ------------------
 1555|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1556|      0|			    filename, linenum);
 1557|      0|			goto out;
 1558|      0|		}
 1559|      0|		len = strspn(str, WHITESPACE "=");
  ------------------
  |  | 1141|      0|#define WHITESPACE " \t\r\n"
  ------------------
 1560|       |		/* XXX use argv? */
 1561|      0|		if (parse_jump(str + len, options, cmdline, *activep) == -1) {
  ------------------
  |  Branch (1561:7): [True: 0, False: 0]
  ------------------
 1562|      0|			error("%.200s line %d: Invalid ProxyJump \"%s\"",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1563|      0|			    filename, linenum, str + len);
 1564|      0|			goto out;
 1565|      0|		}
 1566|      0|		argv_consume(&ac);
 1567|      0|		break;
 1568|       |
 1569|     35|	case oPort:
  ------------------
  |  Branch (1569:2): [True: 35, False: 389]
  ------------------
 1570|     35|		arg = argv_next(&ac, &av);
 1571|     35|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1571:7): [True: 0, False: 35]
  |  Branch (1571:15): [True: 0, False: 35]
  ------------------
 1572|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1573|      0|			    filename, linenum);
 1574|      0|			goto out;
 1575|      0|		}
 1576|     35|		value = a2port(arg);
 1577|     35|		if (value <= 0) {
  ------------------
  |  Branch (1577:7): [True: 0, False: 35]
  ------------------
 1578|      0|			error("%.200s line %d: Bad port '%s'.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1579|      0|			    filename, linenum, arg);
 1580|      0|			goto out;
 1581|      0|		}
 1582|     35|		if (*activep && options->port == -1)
  ------------------
  |  Branch (1582:7): [True: 35, False: 0]
  |  Branch (1582:19): [True: 9, False: 26]
  ------------------
 1583|      9|			options->port = value;
 1584|     35|		break;
 1585|       |
 1586|      0|	case oConnectionAttempts:
  ------------------
  |  Branch (1586:2): [True: 0, False: 424]
  ------------------
 1587|      0|		intptr = &options->connection_attempts;
 1588|      0|parse_int:
 1589|      0|		arg = argv_next(&ac, &av);
 1590|      0|		if ((errstr = atoi_err(arg, &value)) != NULL) {
  ------------------
  |  Branch (1590:7): [True: 0, False: 0]
  ------------------
 1591|      0|			error("%s line %d: integer value %s.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1592|      0|			    filename, linenum, errstr);
 1593|      0|			goto out;
 1594|      0|		}
 1595|      0|		if (*activep && *intptr == -1)
  ------------------
  |  Branch (1595:7): [True: 0, False: 0]
  |  Branch (1595:19): [True: 0, False: 0]
  ------------------
 1596|      0|			*intptr = value;
 1597|      0|		break;
 1598|       |
 1599|      0|	case oCiphers:
  ------------------
  |  Branch (1599:2): [True: 0, False: 424]
  ------------------
 1600|      0|		arg = argv_next(&ac, &av);
 1601|      0|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1601:7): [True: 0, False: 0]
  |  Branch (1601:15): [True: 0, False: 0]
  ------------------
 1602|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1603|      0|			    filename, linenum);
 1604|      0|			goto out;
 1605|      0|		}
 1606|      0|		if (*arg != '-' &&
  ------------------
  |  Branch (1606:7): [True: 0, False: 0]
  ------------------
 1607|      0|		    !ciphers_valid(*arg == '+' || *arg == '^' ? arg + 1 : arg)){
  ------------------
  |  Branch (1607:7): [True: 0, False: 0]
  |  Branch (1607:22): [True: 0, False: 0]
  |  Branch (1607:37): [True: 0, False: 0]
  ------------------
 1608|      0|			error("%.200s line %d: Bad SSH2 cipher spec '%s'.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  |  |  ------------------
  |  |  |  Branch (114:87): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1609|      0|			    filename, linenum, arg ? arg : "<NONE>");
 1610|      0|			goto out;
 1611|      0|		}
 1612|      0|		if (*activep && options->ciphers == NULL)
  ------------------
  |  Branch (1612:7): [True: 0, False: 0]
  |  Branch (1612:19): [True: 0, False: 0]
  ------------------
 1613|      0|			options->ciphers = xstrdup(arg);
 1614|      0|		break;
 1615|       |
 1616|      0|	case oMacs:
  ------------------
  |  Branch (1616:2): [True: 0, False: 424]
  ------------------
 1617|      0|		arg = argv_next(&ac, &av);
 1618|      0|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1618:7): [True: 0, False: 0]
  |  Branch (1618:15): [True: 0, False: 0]
  ------------------
 1619|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1620|      0|			    filename, linenum);
 1621|      0|			goto out;
 1622|      0|		}
 1623|      0|		if (*arg != '-' &&
  ------------------
  |  Branch (1623:7): [True: 0, False: 0]
  ------------------
 1624|      0|		    !mac_valid(*arg == '+' || *arg == '^' ? arg + 1 : arg)) {
  ------------------
  |  Branch (1624:7): [True: 0, False: 0]
  |  Branch (1624:18): [True: 0, False: 0]
  |  Branch (1624:33): [True: 0, False: 0]
  ------------------
 1625|      0|			error("%.200s line %d: Bad SSH2 MAC spec '%s'.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  |  |  ------------------
  |  |  |  Branch (114:87): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1626|      0|			    filename, linenum, arg ? arg : "<NONE>");
 1627|      0|			goto out;
 1628|      0|		}
 1629|      0|		if (*activep && options->macs == NULL)
  ------------------
  |  Branch (1629:7): [True: 0, False: 0]
  |  Branch (1629:19): [True: 0, False: 0]
  ------------------
 1630|      0|			options->macs = xstrdup(arg);
 1631|      0|		break;
 1632|       |
 1633|      1|	case oKexAlgorithms:
  ------------------
  |  Branch (1633:2): [True: 1, False: 423]
  ------------------
 1634|      1|		arg = argv_next(&ac, &av);
 1635|      1|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1635:7): [True: 0, False: 1]
  |  Branch (1635:15): [True: 0, False: 1]
  ------------------
 1636|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1637|      0|			    filename, linenum);
 1638|      0|			goto out;
 1639|      0|		}
 1640|      1|		if (*arg != '-' &&
  ------------------
  |  Branch (1640:7): [True: 1, False: 0]
  ------------------
 1641|      1|		    !kex_names_valid(*arg == '+' || *arg == '^' ?
  ------------------
  |  Branch (1641:7): [True: 0, False: 1]
  |  Branch (1641:24): [True: 0, False: 1]
  |  Branch (1641:39): [True: 0, False: 1]
  ------------------
 1642|      1|		    arg + 1 : arg)) {
 1643|      0|			error("%.200s line %d: Bad SSH2 KexAlgorithms '%s'.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  |  |  ------------------
  |  |  |  Branch (114:87): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1644|      0|			    filename, linenum, arg ? arg : "<NONE>");
 1645|      0|			goto out;
 1646|      0|		}
 1647|      1|		if (*activep && options->kex_algorithms == NULL)
  ------------------
  |  Branch (1647:7): [True: 1, False: 0]
  |  Branch (1647:19): [True: 1, False: 0]
  ------------------
 1648|      1|			options->kex_algorithms = xstrdup(arg);
 1649|      1|		break;
 1650|       |
 1651|      0|	case oHostKeyAlgorithms:
  ------------------
  |  Branch (1651:2): [True: 0, False: 424]
  ------------------
 1652|      0|		charptr = &options->hostkeyalgorithms;
 1653|      0|		ca_only = 0;
 1654|     20|parse_pubkey_algos:
 1655|     20|		arg = argv_next(&ac, &av);
 1656|     20|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1656:7): [True: 0, False: 20]
  |  Branch (1656:15): [True: 0, False: 20]
  ------------------
 1657|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1658|      0|			    filename, linenum);
 1659|      0|			goto out;
 1660|      0|		}
 1661|     20|		if (*arg != '-' &&
  ------------------
  |  Branch (1661:7): [True: 20, False: 0]
  ------------------
 1662|     20|		    !sshkey_names_valid2(*arg == '+' || *arg == '^' ?
  ------------------
  |  Branch (1662:7): [True: 0, False: 20]
  |  Branch (1662:28): [True: 0, False: 20]
  |  Branch (1662:43): [True: 0, False: 20]
  ------------------
 1663|     20|		    arg + 1 : arg, 1, ca_only)) {
 1664|      0|			error("%s line %d: Bad key types '%s'.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  |  |  ------------------
  |  |  |  Branch (114:87): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1665|      0|			    filename, linenum, arg ? arg : "<NONE>");
 1666|      0|			goto out;
 1667|      0|		}
 1668|     20|		if (*activep && *charptr == NULL)
  ------------------
  |  Branch (1668:7): [True: 20, False: 0]
  |  Branch (1668:19): [True: 20, False: 0]
  ------------------
 1669|     20|			*charptr = xstrdup(arg);
 1670|     20|		break;
 1671|       |
 1672|     20|	case oCASignatureAlgorithms:
  ------------------
  |  Branch (1672:2): [True: 20, False: 404]
  ------------------
 1673|     20|		charptr = &options->ca_sign_algorithms;
 1674|     20|		ca_only = 1;
 1675|     20|		goto parse_pubkey_algos;
 1676|       |
 1677|      0|	case oLogLevel:
  ------------------
  |  Branch (1677:2): [True: 0, False: 424]
  ------------------
 1678|      0|		log_level_ptr = &options->log_level;
 1679|      0|		arg = argv_next(&ac, &av);
 1680|      0|		value = log_level_number(arg);
 1681|      0|		if (value == SYSLOG_LEVEL_NOT_SET) {
  ------------------
  |  Branch (1681:7): [True: 0, False: 0]
  ------------------
 1682|      0|			error("%.200s line %d: unsupported log level '%s'",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  |  |  ------------------
  |  |  |  Branch (114:87): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1683|      0|			    filename, linenum, arg ? arg : "<NONE>");
 1684|      0|			goto out;
 1685|      0|		}
 1686|      0|		if (*activep && *log_level_ptr == SYSLOG_LEVEL_NOT_SET)
  ------------------
  |  Branch (1686:7): [True: 0, False: 0]
  |  Branch (1686:19): [True: 0, False: 0]
  ------------------
 1687|      0|			*log_level_ptr = (LogLevel) value;
 1688|      0|		break;
 1689|       |
 1690|      0|	case oLogFacility:
  ------------------
  |  Branch (1690:2): [True: 0, False: 424]
  ------------------
 1691|      0|		log_facility_ptr = &options->log_facility;
 1692|      0|		arg = argv_next(&ac, &av);
 1693|      0|		value = log_facility_number(arg);
 1694|      0|		if (value == SYSLOG_FACILITY_NOT_SET) {
  ------------------
  |  Branch (1694:7): [True: 0, False: 0]
  ------------------
 1695|      0|			error("%.200s line %d: unsupported log facility '%s'",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  |  |  ------------------
  |  |  |  Branch (114:87): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1696|      0|			    filename, linenum, arg ? arg : "<NONE>");
 1697|      0|			goto out;
 1698|      0|		}
 1699|      0|		if (*log_facility_ptr == -1)
  ------------------
  |  Branch (1699:7): [True: 0, False: 0]
  ------------------
 1700|      0|			*log_facility_ptr = (SyslogFacility) value;
 1701|      0|		break;
 1702|       |
 1703|     22|	case oLogVerbose:
  ------------------
  |  Branch (1703:2): [True: 22, False: 402]
  ------------------
 1704|     22|		cppptr = &options->log_verbose;
 1705|     22|		uintptr = &options->num_log_verbose;
 1706|     22|		i = 0;
 1707|    306|		while ((arg = argv_next(&ac, &av)) != NULL) {
  ------------------
  |  Branch (1707:10): [True: 284, False: 22]
  ------------------
 1708|    284|			if (*arg == '\0') {
  ------------------
  |  Branch (1708:8): [True: 0, False: 284]
  ------------------
 1709|      0|				error("%s line %d: keyword %s empty argument",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1710|      0|				    filename, linenum, keyword);
 1711|      0|				goto out;
 1712|      0|			}
 1713|       |			/* Allow "none" only in first position */
 1714|    284|			if (strcasecmp(arg, "none") == 0) {
  ------------------
  |  Branch (1714:8): [True: 0, False: 284]
  ------------------
 1715|      0|				if (i > 0 || ac > 0) {
  ------------------
  |  Branch (1715:9): [True: 0, False: 0]
  |  Branch (1715:18): [True: 0, False: 0]
  ------------------
 1716|      0|					error("%s line %d: keyword %s \"none\" "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1717|      0|					    "argument must appear alone.",
 1718|      0|					    filename, linenum, keyword);
 1719|      0|					goto out;
 1720|      0|				}
 1721|      0|			}
 1722|    284|			i++;
 1723|    284|			if (*activep && *uintptr == 0) {
  ------------------
  |  Branch (1723:8): [True: 236, False: 48]
  |  Branch (1723:20): [True: 7, False: 229]
  ------------------
 1724|      7|				*cppptr = xrecallocarray(*cppptr, *uintptr,
 1725|      7|				    *uintptr + 1, sizeof(**cppptr));
 1726|      7|				(*cppptr)[(*uintptr)++] = xstrdup(arg);
 1727|      7|			}
 1728|    284|		}
 1729|     22|		break;
 1730|       |
 1731|     22|	case oLocalForward:
  ------------------
  |  Branch (1731:2): [True: 0, False: 424]
  ------------------
 1732|      4|	case oRemoteForward:
  ------------------
  |  Branch (1732:2): [True: 4, False: 420]
  ------------------
 1733|      4|	case oDynamicForward:
  ------------------
  |  Branch (1733:2): [True: 0, False: 424]
  ------------------
 1734|      4|		arg = argv_next(&ac, &av);
 1735|      4|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1735:7): [True: 0, False: 4]
  |  Branch (1735:15): [True: 0, False: 4]
  ------------------
 1736|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1737|      0|			    filename, linenum);
 1738|      0|			goto out;
 1739|      0|		}
 1740|       |
 1741|      4|		remotefwd = (opcode == oRemoteForward);
 1742|      4|		dynamicfwd = (opcode == oDynamicForward);
 1743|       |
 1744|      4|		if (!dynamicfwd) {
  ------------------
  |  Branch (1744:7): [True: 4, False: 0]
  ------------------
 1745|      4|			arg2 = argv_next(&ac, &av);
 1746|      4|			if (arg2 == NULL || *arg2 == '\0') {
  ------------------
  |  Branch (1746:8): [True: 2, False: 2]
  |  Branch (1746:24): [True: 0, False: 2]
  ------------------
 1747|      2|				if (remotefwd)
  ------------------
  |  Branch (1747:9): [True: 2, False: 0]
  ------------------
 1748|      2|					dynamicfwd = 1;
 1749|      0|				else {
 1750|      0|					error("%.200s line %d: Missing target "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1751|      0|					    "argument.", filename, linenum);
 1752|      0|					goto out;
 1753|      0|				}
 1754|      2|			} else {
 1755|       |				/* construct a string for parse_forward */
 1756|      2|				snprintf(fwdarg, sizeof(fwdarg), "%s:%s", arg,
 1757|      2|				    arg2);
 1758|      2|			}
 1759|      4|		}
 1760|      4|		if (dynamicfwd)
  ------------------
  |  Branch (1760:7): [True: 2, False: 2]
  ------------------
 1761|      2|			strlcpy(fwdarg, arg, sizeof(fwdarg));
 1762|       |
 1763|      4|		if (parse_forward(&fwd, fwdarg, dynamicfwd, remotefwd) == 0) {
  ------------------
  |  Branch (1763:7): [True: 0, False: 4]
  ------------------
 1764|      0|			error("%.200s line %d: Bad forwarding specification.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1765|      0|			    filename, linenum);
 1766|      0|			goto out;
 1767|      0|		}
 1768|       |
 1769|      4|		if (*activep) {
  ------------------
  |  Branch (1769:7): [True: 4, False: 0]
  ------------------
 1770|      4|			if (remotefwd) {
  ------------------
  |  Branch (1770:8): [True: 4, False: 0]
  ------------------
 1771|      4|				add_remote_forward(options, &fwd);
 1772|      4|			} else {
 1773|      0|				add_local_forward(options, &fwd);
 1774|      0|			}
 1775|      4|		}
 1776|      4|		break;
 1777|       |
 1778|      3|	case oPermitRemoteOpen:
  ------------------
  |  Branch (1778:2): [True: 3, False: 421]
  ------------------
 1779|      3|		uintptr = &options->num_permitted_remote_opens;
 1780|      3|		cppptr = &options->permitted_remote_opens;
 1781|      3|		found = *uintptr == 0;
 1782|     10|		while ((arg = argv_next(&ac, &av)) != NULL) {
  ------------------
  |  Branch (1782:10): [True: 7, False: 3]
  ------------------
 1783|      7|			arg2 = xstrdup(arg);
 1784|       |			/* Allow any/none only in first position */
 1785|      7|			if (strcasecmp(arg, "none") == 0 ||
  ------------------
  |  Branch (1785:8): [True: 0, False: 7]
  ------------------
 1786|      7|			    strcasecmp(arg, "any") == 0) {
  ------------------
  |  Branch (1786:8): [True: 0, False: 7]
  ------------------
 1787|      0|				if (nstrs > 0 || ac > 0) {
  ------------------
  |  Branch (1787:9): [True: 0, False: 0]
  |  Branch (1787:22): [True: 0, False: 0]
  ------------------
 1788|      0|					error("%s line %d: keyword %s \"%s\" "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1789|      0|					    "argument must appear alone.",
 1790|      0|					    filename, linenum, keyword, arg);
 1791|      0|					free(arg2);
 1792|      0|					goto out;
 1793|      0|				}
 1794|      7|			} else {
 1795|      7|				p = hpdelim(&arg);
 1796|      7|				if (p == NULL) {
  ------------------
  |  Branch (1796:9): [True: 0, False: 7]
  ------------------
 1797|      0|					fatal("%s line %d: missing host in %s",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 1798|      0|					    filename, linenum,
 1799|      0|					    lookup_opcode_name(opcode));
 1800|      0|				}
 1801|      7|				p = cleanhostname(p);
 1802|       |				/*
 1803|       |				 * don't want to use permitopen_port to avoid
 1804|       |				 * dependency on channels.[ch] here.
 1805|       |				 */
 1806|      7|				if (arg == NULL || (strcmp(arg, "*") != 0 &&
  ------------------
  |  Branch (1806:9): [True: 0, False: 7]
  |  Branch (1806:25): [True: 7, False: 0]
  ------------------
 1807|      7|				    a2port(arg) <= 0)) {
  ------------------
  |  Branch (1807:9): [True: 0, False: 7]
  ------------------
 1808|      0|					fatal("%s line %d: bad port number "
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 1809|      0|					    "in %s", filename, linenum,
 1810|      0|					    lookup_opcode_name(opcode));
 1811|      0|				}
 1812|      7|			}
 1813|      7|			opt_array_append(filename, linenum,
 1814|      7|			    lookup_opcode_name(opcode),
 1815|      7|			    &strs, &nstrs, arg2);
 1816|      7|			free(arg2);
 1817|      7|		}
 1818|      3|		if (nstrs == 0)
  ------------------
  |  Branch (1818:7): [True: 0, False: 3]
  ------------------
 1819|      0|			fatal("%s line %d: missing %s specification",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 1820|      3|			    filename, linenum, lookup_opcode_name(opcode));
 1821|      3|		if (found && *activep) {
  ------------------
  |  Branch (1821:7): [True: 3, False: 0]
  |  Branch (1821:16): [True: 3, False: 0]
  ------------------
 1822|      3|			*cppptr = strs;
 1823|      3|			*uintptr = nstrs;
 1824|      3|			strs = NULL; /* transferred */
 1825|      3|			nstrs = 0;
 1826|      3|		}
 1827|      3|		break;
 1828|       |
 1829|      0|	case oClearAllForwardings:
  ------------------
  |  Branch (1829:2): [True: 0, False: 424]
  ------------------
 1830|      0|		intptr = &options->clear_forwardings;
 1831|      0|		goto parse_flag;
 1832|       |
 1833|     23|	case oHost:
  ------------------
  |  Branch (1833:2): [True: 23, False: 401]
  ------------------
 1834|     23|		if (cmdline) {
  ------------------
  |  Branch (1834:7): [True: 0, False: 23]
  ------------------
 1835|      0|			error("Host directive not supported as a command-line "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1836|      0|			    "option");
 1837|      0|			goto out;
 1838|      0|		}
 1839|     23|		*activep = 0;
 1840|     23|		arg2 = NULL;
 1841|    174|		while ((arg = argv_next(&ac, &av)) != NULL) {
  ------------------
  |  Branch (1841:10): [True: 152, False: 22]
  ------------------
 1842|    152|			if (*arg == '\0') {
  ------------------
  |  Branch (1842:8): [True: 0, False: 152]
  ------------------
 1843|      0|				error("%s line %d: keyword %s empty argument",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1844|      0|				    filename, linenum, keyword);
 1845|      0|				goto out;
 1846|      0|			}
 1847|    152|			if ((flags & SSHCONF_NEVERMATCH) != 0) {
  ------------------
  |  |  222|    152|#define SSHCONF_NEVERMATCH	8  /* Match/Host never matches; internal only */
  ------------------
  |  Branch (1847:8): [True: 0, False: 152]
  ------------------
 1848|      0|				argv_consume(&ac);
 1849|      0|				break;
 1850|      0|			}
 1851|    152|			negated = *arg == '!';
 1852|    152|			if (negated)
  ------------------
  |  Branch (1852:8): [True: 24, False: 128]
  ------------------
 1853|     24|				arg++;
 1854|    152|			if (match_pattern(host, arg)) {
  ------------------
  |  Branch (1854:8): [True: 5, False: 147]
  ------------------
 1855|      5|				if (negated) {
  ------------------
  |  Branch (1855:9): [True: 1, False: 4]
  ------------------
 1856|      1|					debug("%.200s line %d: Skipping Host "
  ------------------
  |  |  111|      1|#define debug(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG1, NULL, __VA_ARGS__)
  ------------------
 1857|      1|					    "block because of negated match "
 1858|      1|					    "for %.100s", filename, linenum,
 1859|      1|					    arg);
 1860|      1|					*activep = 0;
 1861|      1|					argv_consume(&ac);
 1862|      1|					break;
 1863|      1|				}
 1864|      4|				if (!*activep)
  ------------------
  |  Branch (1864:9): [True: 1, False: 3]
  ------------------
 1865|      1|					arg2 = arg; /* logged below */
 1866|      4|				*activep = 1;
 1867|      4|			}
 1868|    152|		}
 1869|     23|		if (*activep)
  ------------------
  |  Branch (1869:7): [True: 1, False: 22]
  ------------------
 1870|      1|			debug("%.200s line %d: Applying options for %.100s",
  ------------------
  |  |  111|      1|#define debug(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG1, NULL, __VA_ARGS__)
  ------------------
 1871|     23|			    filename, linenum, arg2);
 1872|     23|		break;
 1873|       |
 1874|      0|	case oMatch:
  ------------------
  |  Branch (1874:2): [True: 0, False: 424]
  ------------------
 1875|      0|		if (cmdline) {
  ------------------
  |  Branch (1875:7): [True: 0, False: 0]
  ------------------
 1876|      0|			error("Match directive not supported as a command-line "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1877|      0|			    "option");
 1878|      0|			goto out;
 1879|      0|		}
 1880|      0|		value = match_cfg_line(options, str, &ac, &av, pw, host,
 1881|      0|		    original_host, remote_command, flags & SSHCONF_FINAL,
  ------------------
  |  |  221|      0|#define SSHCONF_FINAL		4  /* Final pass over config, after canon. */
  ------------------
 1882|      0|		    want_final_pass, filename, linenum);
 1883|      0|		if (value < 0) {
  ------------------
  |  Branch (1883:7): [True: 0, False: 0]
  ------------------
 1884|      0|			error("%.200s line %d: Bad Match condition", filename,
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1885|      0|			    linenum);
 1886|      0|			goto out;
 1887|      0|		}
 1888|      0|		*activep = (flags & SSHCONF_NEVERMATCH) ? 0 : value;
  ------------------
  |  |  222|      0|#define SSHCONF_NEVERMATCH	8  /* Match/Host never matches; internal only */
  ------------------
  |  Branch (1888:14): [True: 0, False: 0]
  ------------------
 1889|      0|		break;
 1890|       |
 1891|      0|	case oEscapeChar:
  ------------------
  |  Branch (1891:2): [True: 0, False: 424]
  ------------------
 1892|      0|		intptr = &options->escape_char;
 1893|      0|		arg = argv_next(&ac, &av);
 1894|      0|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1894:7): [True: 0, False: 0]
  |  Branch (1894:15): [True: 0, False: 0]
  ------------------
 1895|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1896|      0|			    filename, linenum);
 1897|      0|			goto out;
 1898|      0|		}
 1899|      0|		if (strcmp(arg, "none") == 0)
  ------------------
  |  Branch (1899:7): [True: 0, False: 0]
  ------------------
 1900|      0|			value = SSH_ESCAPECHAR_NONE;
  ------------------
  |  |   77|      0|#define SSH_ESCAPECHAR_NONE		-2
  ------------------
 1901|      0|		else if (arg[1] == '\0')
  ------------------
  |  Branch (1901:12): [True: 0, False: 0]
  ------------------
 1902|      0|			value = (u_char) arg[0];
 1903|      0|		else if (arg[0] == '^' && arg[2] == 0 &&
  ------------------
  |  Branch (1903:12): [True: 0, False: 0]
  |  Branch (1903:29): [True: 0, False: 0]
  ------------------
 1904|      0|		    (u_char) arg[1] >= 64 && (u_char) arg[1] < 128)
  ------------------
  |  Branch (1904:7): [True: 0, False: 0]
  |  Branch (1904:32): [True: 0, False: 0]
  ------------------
 1905|      0|			value = (u_char) arg[1] & 31;
 1906|      0|		else {
 1907|      0|			error("%.200s line %d: Bad escape character.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1908|      0|			    filename, linenum);
 1909|      0|			goto out;
 1910|      0|		}
 1911|      0|		if (*activep && *intptr == -1)
  ------------------
  |  Branch (1911:7): [True: 0, False: 0]
  |  Branch (1911:19): [True: 0, False: 0]
  ------------------
 1912|      0|			*intptr = value;
 1913|      0|		break;
 1914|       |
 1915|      0|	case oAddressFamily:
  ------------------
  |  Branch (1915:2): [True: 0, False: 424]
  ------------------
 1916|      0|		intptr = &options->address_family;
 1917|      0|		multistate_ptr = multistate_addressfamily;
 1918|      0|		goto parse_multistate;
 1919|       |
 1920|      0|	case oEnableSSHKeysign:
  ------------------
  |  Branch (1920:2): [True: 0, False: 424]
  ------------------
 1921|      0|		intptr = &options->enable_ssh_keysign;
 1922|      0|		goto parse_flag;
 1923|       |
 1924|      0|	case oIdentitiesOnly:
  ------------------
  |  Branch (1924:2): [True: 0, False: 424]
  ------------------
 1925|      0|		intptr = &options->identities_only;
 1926|      0|		goto parse_flag;
 1927|       |
 1928|      0|	case oServerAliveInterval:
  ------------------
  |  Branch (1928:2): [True: 0, False: 424]
  ------------------
 1929|      0|		intptr = &options->server_alive_interval;
 1930|      0|		goto parse_time;
 1931|       |
 1932|      0|	case oServerAliveCountMax:
  ------------------
  |  Branch (1932:2): [True: 0, False: 424]
  ------------------
 1933|      0|		intptr = &options->server_alive_count_max;
 1934|      0|		goto parse_int;
 1935|       |
 1936|     43|	case oSendEnv:
  ------------------
  |  Branch (1936:2): [True: 43, False: 381]
  ------------------
 1937|       |		/* XXX appends to list; doesn't respect first-match-wins */
 1938|  3.10k|		while ((arg = argv_next(&ac, &av)) != NULL) {
  ------------------
  |  Branch (1938:10): [True: 3.05k, False: 43]
  ------------------
 1939|  3.05k|			if (*arg == '\0' || strchr(arg, '=') != NULL) {
  ------------------
  |  Branch (1939:8): [True: 0, False: 3.05k]
  |  Branch (1939:24): [True: 0, False: 3.05k]
  ------------------
 1940|      0|				error("%s line %d: Invalid environment name.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1941|      0|				    filename, linenum);
 1942|      0|				goto out;
 1943|      0|			}
 1944|  3.05k|			found = 1;
 1945|  3.05k|			if (!*activep)
  ------------------
  |  Branch (1945:8): [True: 0, False: 3.05k]
  ------------------
 1946|      0|				continue;
 1947|  3.05k|			if (*arg == '-') {
  ------------------
  |  Branch (1947:8): [True: 2.36k, False: 691]
  ------------------
 1948|       |				/* Removing an env var */
 1949|  2.36k|				rm_env(options, arg, filename, linenum);
 1950|  2.36k|				continue;
 1951|  2.36k|			}
 1952|    691|			opt_array_append(filename, linenum,
 1953|    691|			    lookup_opcode_name(opcode),
 1954|    691|			    &options->send_env, &options->num_send_env, arg);
 1955|    691|		}
 1956|     43|		if (!found) {
  ------------------
  |  Branch (1956:7): [True: 0, False: 43]
  ------------------
 1957|      0|			fatal("%s line %d: no %s specified",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 1958|      0|			    filename, linenum, keyword);
 1959|      0|		}
 1960|     43|		break;
 1961|       |
 1962|     43|	case oSetEnv:
  ------------------
  |  Branch (1962:2): [True: 31, False: 393]
  ------------------
 1963|     31|		found = options->num_setenv == 0;
 1964|    551|		while ((arg = argv_next(&ac, &av)) != NULL) {
  ------------------
  |  Branch (1964:10): [True: 520, False: 31]
  ------------------
 1965|    520|			if (strchr(arg, '=') == NULL) {
  ------------------
  |  Branch (1965:8): [True: 0, False: 520]
  ------------------
 1966|      0|				error("%s line %d: Invalid SetEnv.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1967|      0|				    filename, linenum);
 1968|      0|				goto out;
 1969|      0|			}
 1970|    520|			if (lookup_setenv_in_list(arg, strs, nstrs) != NULL) {
  ------------------
  |  Branch (1970:8): [True: 336, False: 184]
  ------------------
 1971|    336|				debug2("%s line %d: ignoring duplicate env "
  ------------------
  |  |  110|    336|#define debug2(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG2, NULL, __VA_ARGS__)
  ------------------
 1972|    336|				    "name \"%.64s\"", filename, linenum, arg);
 1973|    336|				continue;
 1974|    336|			}
 1975|    184|			opt_array_append(filename, linenum,
 1976|    184|			    lookup_opcode_name(opcode),
 1977|    184|			    &strs, &nstrs, arg);
 1978|    184|		}
 1979|     31|		if (nstrs == 0) {
  ------------------
  |  Branch (1979:7): [True: 0, False: 31]
  ------------------
 1980|      0|			fatal("%s line %d: no %s specified",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 1981|      0|			    filename, linenum, keyword);
 1982|      0|		}
 1983|     31|		if (found && *activep) {
  ------------------
  |  Branch (1983:7): [True: 31, False: 0]
  |  Branch (1983:16): [True: 26, False: 5]
  ------------------
 1984|     26|			options->setenv = strs;
 1985|     26|			options->num_setenv = nstrs;
 1986|     26|			strs = NULL; /* transferred */
 1987|     26|			nstrs = 0;
 1988|     26|		}
 1989|     31|		break;
 1990|       |
 1991|      0|	case oControlPath:
  ------------------
  |  Branch (1991:2): [True: 0, False: 424]
  ------------------
 1992|      0|		charptr = &options->control_path;
 1993|      0|		goto parse_string;
 1994|       |
 1995|      0|	case oControlMaster:
  ------------------
  |  Branch (1995:2): [True: 0, False: 424]
  ------------------
 1996|      0|		intptr = &options->control_master;
 1997|      0|		multistate_ptr = multistate_controlmaster;
 1998|      0|		goto parse_multistate;
 1999|       |
 2000|      0|	case oControlPersist:
  ------------------
  |  Branch (2000:2): [True: 0, False: 424]
  ------------------
 2001|       |		/* no/false/yes/true, or a time spec */
 2002|      0|		intptr = &options->control_persist;
 2003|      0|		arg = argv_next(&ac, &av);
 2004|      0|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (2004:7): [True: 0, False: 0]
  |  Branch (2004:15): [True: 0, False: 0]
  ------------------
 2005|      0|			error("%.200s line %d: Missing ControlPersist"
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2006|      0|			    " argument.", filename, linenum);
 2007|      0|			goto out;
 2008|      0|		}
 2009|      0|		value = 0;
 2010|      0|		value2 = 0;	/* timeout */
 2011|      0|		if (strcmp(arg, "no") == 0 || strcmp(arg, "false") == 0)
  ------------------
  |  Branch (2011:7): [True: 0, False: 0]
  |  Branch (2011:33): [True: 0, False: 0]
  ------------------
 2012|      0|			value = 0;
 2013|      0|		else if (strcmp(arg, "yes") == 0 || strcmp(arg, "true") == 0)
  ------------------
  |  Branch (2013:12): [True: 0, False: 0]
  |  Branch (2013:39): [True: 0, False: 0]
  ------------------
 2014|      0|			value = 1;
 2015|      0|		else if ((value2 = convtime(arg)) >= 0)
  ------------------
  |  Branch (2015:12): [True: 0, False: 0]
  ------------------
 2016|      0|			value = 1;
 2017|      0|		else {
 2018|      0|			error("%.200s line %d: Bad ControlPersist argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2019|      0|			    filename, linenum);
 2020|      0|			goto out;
 2021|      0|		}
 2022|      0|		if (*activep && *intptr == -1) {
  ------------------
  |  Branch (2022:7): [True: 0, False: 0]
  |  Branch (2022:19): [True: 0, False: 0]
  ------------------
 2023|      0|			*intptr = value;
 2024|      0|			options->control_persist_timeout = value2;
 2025|      0|		}
 2026|      0|		break;
 2027|       |
 2028|      0|	case oHashKnownHosts:
  ------------------
  |  Branch (2028:2): [True: 0, False: 424]
  ------------------
 2029|      0|		intptr = &options->hash_known_hosts;
 2030|      0|		goto parse_flag;
 2031|       |
 2032|      0|	case oTunnel:
  ------------------
  |  Branch (2032:2): [True: 0, False: 424]
  ------------------
 2033|      0|		intptr = &options->tun_open;
 2034|      0|		multistate_ptr = multistate_tunnel;
 2035|      0|		goto parse_multistate;
 2036|       |
 2037|      0|	case oTunnelDevice:
  ------------------
  |  Branch (2037:2): [True: 0, False: 424]
  ------------------
 2038|      0|		arg = argv_next(&ac, &av);
 2039|      0|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (2039:7): [True: 0, False: 0]
  |  Branch (2039:15): [True: 0, False: 0]
  ------------------
 2040|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2041|      0|			    filename, linenum);
 2042|      0|			goto out;
 2043|      0|		}
 2044|      0|		value = a2tun(arg, &value2);
 2045|      0|		if (value == SSH_TUNID_ERR) {
  ------------------
  |  |  158|      0|#define SSH_TUNID_ERR		(SSH_TUNID_ANY - 1)
  |  |  ------------------
  |  |  |  |  157|      0|#define SSH_TUNID_ANY		0x7fffffff
  |  |  ------------------
  ------------------
  |  Branch (2045:7): [True: 0, False: 0]
  ------------------
 2046|      0|			error("%.200s line %d: Bad tun device.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2047|      0|			    filename, linenum);
 2048|      0|			goto out;
 2049|      0|		}
 2050|      0|		if (*activep && options->tun_local == -1) {
  ------------------
  |  Branch (2050:7): [True: 0, False: 0]
  |  Branch (2050:19): [True: 0, False: 0]
  ------------------
 2051|      0|			options->tun_local = value;
 2052|      0|			options->tun_remote = value2;
 2053|      0|		}
 2054|      0|		break;
 2055|       |
 2056|      0|	case oLocalCommand:
  ------------------
  |  Branch (2056:2): [True: 0, False: 424]
  ------------------
 2057|      0|		charptr = &options->local_command;
 2058|      0|		goto parse_command;
 2059|       |
 2060|      0|	case oPermitLocalCommand:
  ------------------
  |  Branch (2060:2): [True: 0, False: 424]
  ------------------
 2061|      0|		intptr = &options->permit_local_command;
 2062|      0|		goto parse_flag;
 2063|       |
 2064|      0|	case oRemoteCommand:
  ------------------
  |  Branch (2064:2): [True: 0, False: 424]
  ------------------
 2065|      0|		charptr = &options->remote_command;
 2066|      0|		goto parse_command;
 2067|       |
 2068|      0|	case oVisualHostKey:
  ------------------
  |  Branch (2068:2): [True: 0, False: 424]
  ------------------
 2069|      0|		intptr = &options->visual_host_key;
 2070|      0|		goto parse_flag;
 2071|       |
 2072|    132|	case oInclude:
  ------------------
  |  Branch (2072:2): [True: 132, False: 292]
  ------------------
 2073|    132|		if (cmdline) {
  ------------------
  |  Branch (2073:7): [True: 0, False: 132]
  ------------------
 2074|      0|			error("Include directive not supported as a "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2075|      0|			    "command-line option");
 2076|      0|			goto out;
 2077|      0|		}
 2078|    132|		value = 0;
 2079|    930|		while ((arg = argv_next(&ac, &av)) != NULL) {
  ------------------
  |  Branch (2079:10): [True: 798, False: 132]
  ------------------
 2080|    798|			if (*arg == '\0') {
  ------------------
  |  Branch (2080:8): [True: 0, False: 798]
  ------------------
 2081|      0|				error("%s line %d: keyword %s empty argument",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2082|      0|				    filename, linenum, keyword);
 2083|      0|				goto out;
 2084|      0|			}
 2085|       |			/* Expand %tokens and environment variables */
 2086|    798|			if ((p = expand_match_exec_or_include_path(arg,
  ------------------
  |  Branch (2086:8): [True: 6, False: 792]
  ------------------
 2087|    798|			    options, pw, host, original_host,
 2088|    798|			    flags & SSHCONF_FINAL, 1)) == NULL) {
  ------------------
  |  |  221|    798|#define SSHCONF_FINAL		4  /* Final pass over config, after canon. */
  ------------------
 2089|      6|				error("%.200s line %d: Unable to expand user "
  ------------------
  |  |  114|      6|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2090|      6|				    "config file '%.100s'",
 2091|      6|				    filename, linenum, arg);
 2092|      6|				continue;
 2093|      6|			}
 2094|       |			/*
 2095|       |			 * Ensure all paths are anchored. User configuration
 2096|       |			 * files may begin with '~/' but system configurations
 2097|       |			 * must not. If the path is relative, then treat it
 2098|       |			 * as living in ~/.ssh for user configurations or
 2099|       |			 * /etc/ssh for system ones.
 2100|       |			 */
 2101|    792|			if (*p == '~' && (flags & SSHCONF_USERCONF) == 0) {
  ------------------
  |  |  220|      0|#define SSHCONF_USERCONF	2  /* user provided config file not system */
  ------------------
  |  Branch (2101:8): [True: 0, False: 792]
  |  Branch (2101:21): [True: 0, False: 0]
  ------------------
 2102|      0|				error("%.200s line %d: bad include path %s.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2103|      0|				    filename, linenum, p);
 2104|      0|				goto out;
 2105|      0|			}
 2106|    792|			if (!path_absolute(p) && *p != '~') {
  ------------------
  |  Branch (2106:8): [True: 738, False: 54]
  |  Branch (2106:29): [True: 738, False: 0]
  ------------------
 2107|    738|				xasprintf(&arg2, "%s/%s",
 2108|    738|				    (flags & SSHCONF_USERCONF) ?
  ------------------
  |  |  220|    738|#define SSHCONF_USERCONF	2  /* user provided config file not system */
  ------------------
  |  Branch (2108:9): [True: 0, False: 738]
  ------------------
 2109|    738|				    "~/" _PATH_SSH_USER_DIR : SSHDIR, p);
  ------------------
  |  |   67|      0|#define _PATH_SSH_USER_DIR		".ssh"
  ------------------
 2110|    738|			} else {
 2111|     54|				arg2 = xstrdup(p);
 2112|     54|			}
 2113|    792|			free(p);
 2114|    792|			memset(&gl, 0, sizeof(gl));
 2115|    792|			r = glob(arg2, GLOB_TILDE, NULL, &gl);
  ------------------
  |  |   52|    792|# define glob(a, b, c, d)  _ssh__compat_glob(a, b, c, d)
  ------------------
 2116|    792|			if (r == GLOB_NOMATCH) {
  ------------------
  |  |   88|    792|#define	GLOB_NOMATCH	(-3)	/* No match and GLOB_NOCHECK not set. */
  ------------------
  |  Branch (2116:8): [True: 792, False: 0]
  ------------------
 2117|    792|				debug("%.200s line %d: include %s matched no "
  ------------------
  |  |  111|    792|#define debug(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG1, NULL, __VA_ARGS__)
  ------------------
 2118|    792|				    "files",filename, linenum, arg2);
 2119|    792|				free(arg2);
 2120|    792|				continue;
 2121|    792|			} else if (r != 0) {
  ------------------
  |  Branch (2121:15): [True: 0, False: 0]
  ------------------
 2122|      0|				error("%.200s line %d: glob failed for %s.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2123|      0|				    filename, linenum, arg2);
 2124|      0|				goto out;
 2125|      0|			}
 2126|      0|			free(arg2);
 2127|      0|			oactive = *activep;
 2128|      0|			for (i = 0; i < gl.gl_pathc; i++) {
  ------------------
  |  Branch (2128:16): [True: 0, False: 0]
  ------------------
 2129|      0|				debug3("%.200s line %d: Including file %s "
  ------------------
  |  |  109|      0|#define debug3(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG3, NULL, __VA_ARGS__)
  |  |  ------------------
  |  |  |  Branch (109:89): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2130|      0|				    "depth %d%s", filename, linenum,
 2131|      0|				    gl.gl_pathv[i], depth,
 2132|      0|				    oactive ? "" : " (parse only)");
 2133|      0|				r = read_config_file_depth(gl.gl_pathv[i],
 2134|      0|				    pw, host, original_host, remote_command,
 2135|      0|				    options, flags | SSHCONF_CHECKPERM |
  ------------------
  |  |  219|      0|#define SSHCONF_CHECKPERM	1  /* check permissions on config file */
  ------------------
 2136|      0|				    (oactive ? 0 : SSHCONF_NEVERMATCH),
  ------------------
  |  |  222|      0|#define SSHCONF_NEVERMATCH	8  /* Match/Host never matches; internal only */
  ------------------
  |  Branch (2136:10): [True: 0, False: 0]
  ------------------
 2137|      0|				    activep, want_final_pass, depth + 1);
 2138|      0|				if (r != 1 && errno != ENOENT) {
  ------------------
  |  Branch (2138:9): [True: 0, False: 0]
  |  Branch (2138:19): [True: 0, False: 0]
  ------------------
 2139|      0|					error("%.200s line %d: Can't open user "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2140|      0|					    "config file %.100s: %.100s",
 2141|      0|					    filename, linenum, gl.gl_pathv[i],
 2142|      0|					    strerror(errno));
 2143|      0|					globfree(&gl);
  ------------------
  |  |   53|      0|# define globfree(a)  _ssh__compat_globfree(a)
  ------------------
 2144|      0|					goto out;
 2145|      0|				}
 2146|       |				/*
 2147|       |				 * don't let Match in includes clobber the
 2148|       |				 * containing file's Match state.
 2149|       |				 */
 2150|      0|				*activep = oactive;
 2151|      0|				if (r != 1)
  ------------------
  |  Branch (2151:9): [True: 0, False: 0]
  ------------------
 2152|      0|					value = -1;
 2153|      0|			}
 2154|      0|			globfree(&gl);
  ------------------
  |  |   53|      0|# define globfree(a)  _ssh__compat_globfree(a)
  ------------------
 2155|      0|		}
 2156|    132|		if (value != 0)
  ------------------
  |  Branch (2156:7): [True: 0, False: 132]
  ------------------
 2157|      0|			ret = value;
 2158|    132|		break;
 2159|       |
 2160|      0|	case oIPQoS:
  ------------------
  |  Branch (2160:2): [True: 0, False: 424]
  ------------------
 2161|      0|		arg = argv_next(&ac, &av);
 2162|      0|		if ((value = parse_ipqos(arg)) == -1) {
  ------------------
  |  Branch (2162:7): [True: 0, False: 0]
  ------------------
 2163|      0|			error("%s line %d: Bad IPQoS value: %s",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2164|      0|			    filename, linenum, arg);
 2165|      0|			goto out;
 2166|      0|		}
 2167|      0|		if (value == INT_MIN) {
  ------------------
  |  Branch (2167:7): [True: 0, False: 0]
  ------------------
 2168|      0|			debug("%s line %d: Deprecated IPQoS value \"%s\" "
  ------------------
  |  |  111|      0|#define debug(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG1, NULL, __VA_ARGS__)
  ------------------
 2169|      0|			    "ignored - using system default instead. Consider"
 2170|      0|			    " using DSCP values.", filename, linenum, arg);
 2171|      0|			value = INT_MAX;
 2172|      0|		}
 2173|      0|		arg = argv_next(&ac, &av);
 2174|      0|		if (arg == NULL)
  ------------------
  |  Branch (2174:7): [True: 0, False: 0]
  ------------------
 2175|      0|			value2 = value;
 2176|      0|		else if ((value2 = parse_ipqos(arg)) == -1) {
  ------------------
  |  Branch (2176:12): [True: 0, False: 0]
  ------------------
 2177|      0|			error("%s line %d: Bad IPQoS value: %s",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2178|      0|			    filename, linenum, arg);
 2179|      0|			goto out;
 2180|      0|		}
 2181|      0|		if (value2 == INT_MIN) {
  ------------------
  |  Branch (2181:7): [True: 0, False: 0]
  ------------------
 2182|      0|			debug("%s line %d: Deprecated IPQoS value \"%s\" "
  ------------------
  |  |  111|      0|#define debug(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG1, NULL, __VA_ARGS__)
  ------------------
 2183|      0|			    "ignored - using system default instead. Consider"
 2184|      0|			    " using DSCP values.", filename, linenum, arg);
 2185|      0|			value2 = INT_MAX;
 2186|      0|		}
 2187|      0|		if (*activep && options->ip_qos_interactive == -1) {
  ------------------
  |  Branch (2187:7): [True: 0, False: 0]
  |  Branch (2187:19): [True: 0, False: 0]
  ------------------
 2188|      0|			options->ip_qos_interactive = value;
 2189|      0|			options->ip_qos_bulk = value2;
 2190|      0|		}
 2191|      0|		break;
 2192|       |
 2193|      0|	case oRequestTTY:
  ------------------
  |  Branch (2193:2): [True: 0, False: 424]
  ------------------
 2194|      0|		intptr = &options->request_tty;
 2195|      0|		multistate_ptr = multistate_requesttty;
 2196|      0|		goto parse_multistate;
 2197|       |
 2198|      0|	case oSessionType:
  ------------------
  |  Branch (2198:2): [True: 0, False: 424]
  ------------------
 2199|      0|		intptr = &options->session_type;
 2200|      0|		multistate_ptr = multistate_sessiontype;
 2201|      0|		goto parse_multistate;
 2202|       |
 2203|      0|	case oStdinNull:
  ------------------
  |  Branch (2203:2): [True: 0, False: 424]
  ------------------
 2204|      0|		intptr = &options->stdin_null;
 2205|      0|		goto parse_flag;
 2206|       |
 2207|      0|	case oForkAfterAuthentication:
  ------------------
  |  Branch (2207:2): [True: 0, False: 424]
  ------------------
 2208|      0|		intptr = &options->fork_after_authentication;
 2209|      0|		goto parse_flag;
 2210|       |
 2211|      1|	case oIgnoreUnknown:
  ------------------
  |  Branch (2211:2): [True: 1, False: 423]
  ------------------
 2212|      1|		charptr = &options->ignored_unknown;
 2213|      1|		goto parse_string;
 2214|       |
 2215|      0|	case oProxyUseFdpass:
  ------------------
  |  Branch (2215:2): [True: 0, False: 424]
  ------------------
 2216|      0|		intptr = &options->proxy_use_fdpass;
 2217|      0|		goto parse_flag;
 2218|       |
 2219|      0|	case oCanonicalDomains:
  ------------------
  |  Branch (2219:2): [True: 0, False: 424]
  ------------------
 2220|      0|		found = options->num_canonical_domains == 0;
 2221|      0|		while ((arg = argv_next(&ac, &av)) != NULL) {
  ------------------
  |  Branch (2221:10): [True: 0, False: 0]
  ------------------
 2222|       |			/* Allow "none" only in first position */
 2223|      0|			if (strcasecmp(arg, "none") == 0) {
  ------------------
  |  Branch (2223:8): [True: 0, False: 0]
  ------------------
 2224|      0|				if (nstrs > 0 || ac > 0) {
  ------------------
  |  Branch (2224:9): [True: 0, False: 0]
  |  Branch (2224:22): [True: 0, False: 0]
  ------------------
 2225|      0|					error("%s line %d: keyword %s \"none\" "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2226|      0|					    "argument must appear alone.",
 2227|      0|					    filename, linenum, keyword);
 2228|      0|					goto out;
 2229|      0|				}
 2230|      0|			}
 2231|      0|			if (!valid_domain(arg, 1, &errstr)) {
  ------------------
  |  Branch (2231:8): [True: 0, False: 0]
  ------------------
 2232|      0|				error("%s line %d: %s", filename, linenum,
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2233|      0|				    errstr);
 2234|      0|				goto out;
 2235|      0|			}
 2236|      0|			opt_array_append(filename, linenum, keyword,
 2237|      0|			    &strs, &nstrs, arg);
 2238|      0|		}
 2239|      0|		if (nstrs == 0) {
  ------------------
  |  Branch (2239:7): [True: 0, False: 0]
  ------------------
 2240|      0|			fatal("%s line %d: no %s specified",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2241|      0|			    filename, linenum, keyword);
 2242|      0|		}
 2243|      0|		if (found && *activep) {
  ------------------
  |  Branch (2243:7): [True: 0, False: 0]
  |  Branch (2243:16): [True: 0, False: 0]
  ------------------
 2244|      0|			options->canonical_domains = strs;
 2245|      0|			options->num_canonical_domains = nstrs;
 2246|      0|			strs = NULL; /* transferred */
 2247|      0|			nstrs = 0;
 2248|      0|		}
 2249|      0|		break;
 2250|       |
 2251|      3|	case oCanonicalizePermittedCNAMEs:
  ------------------
  |  Branch (2251:2): [True: 3, False: 421]
  ------------------
 2252|      3|		found = options->num_permitted_cnames == 0;
 2253|     32|		while ((arg = argv_next(&ac, &av)) != NULL) {
  ------------------
  |  Branch (2253:10): [True: 29, False: 3]
  ------------------
 2254|       |			/*
 2255|       |			 * Either 'none' (only in first position), '*' for
 2256|       |			 * everything or 'list:list'
 2257|       |			 */
 2258|     29|			if (strcasecmp(arg, "none") == 0) {
  ------------------
  |  Branch (2258:8): [True: 0, False: 29]
  ------------------
 2259|      0|				if (ncnames > 0 || ac > 0) {
  ------------------
  |  Branch (2259:9): [True: 0, False: 0]
  |  Branch (2259:24): [True: 0, False: 0]
  ------------------
 2260|      0|					error("%s line %d: keyword %s \"none\" "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2261|      0|					    "argument must appear alone.",
 2262|      0|					    filename, linenum, keyword);
 2263|      0|					goto out;
 2264|      0|				}
 2265|      0|				arg2 = "";
 2266|     29|			} else if (strcmp(arg, "*") == 0) {
  ------------------
  |  Branch (2266:15): [True: 9, False: 20]
  ------------------
 2267|      9|				arg2 = arg;
 2268|     20|			} else {
 2269|     20|				lowercase(arg);
 2270|     20|				if ((arg2 = strchr(arg, ':')) == NULL ||
  ------------------
  |  Branch (2270:9): [True: 0, False: 20]
  ------------------
 2271|     20|				    arg2[1] == '\0') {
  ------------------
  |  Branch (2271:9): [True: 0, False: 20]
  ------------------
 2272|      0|					error("%s line %d: "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2273|      0|					    "Invalid permitted CNAME \"%s\"",
 2274|      0|					    filename, linenum, arg);
 2275|      0|					goto out;
 2276|      0|				}
 2277|     20|				*arg2 = '\0';
 2278|     20|				arg2++;
 2279|     20|			}
 2280|     29|			cnames = xrecallocarray(cnames, ncnames, ncnames + 1,
 2281|     29|			    sizeof(*cnames));
 2282|     29|			cnames[ncnames].source_list = xstrdup(arg);
 2283|     29|			cnames[ncnames].target_list = xstrdup(arg2);
 2284|     29|			ncnames++;
 2285|     29|		}
 2286|      3|		if (ncnames == 0) {
  ------------------
  |  Branch (2286:7): [True: 0, False: 3]
  ------------------
 2287|      0|			fatal("%s line %d: no %s specified",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2288|      0|			    filename, linenum, keyword);
 2289|      0|		}
 2290|      3|		if (found && *activep) {
  ------------------
  |  Branch (2290:7): [True: 3, False: 0]
  |  Branch (2290:16): [True: 3, False: 0]
  ------------------
 2291|      3|			options->permitted_cnames = cnames;
 2292|      3|			options->num_permitted_cnames = ncnames;
 2293|      3|			cnames = NULL; /* transferred */
 2294|      3|			ncnames = 0;
 2295|      3|		}
 2296|       |		/* un-transferred cnames is cleaned up before exit */
 2297|      3|		break;
 2298|       |
 2299|      0|	case oCanonicalizeHostname:
  ------------------
  |  Branch (2299:2): [True: 0, False: 424]
  ------------------
 2300|      0|		intptr = &options->canonicalize_hostname;
 2301|      0|		multistate_ptr = multistate_canonicalizehostname;
 2302|      0|		goto parse_multistate;
 2303|       |
 2304|      0|	case oCanonicalizeMaxDots:
  ------------------
  |  Branch (2304:2): [True: 0, False: 424]
  ------------------
 2305|      0|		intptr = &options->canonicalize_max_dots;
 2306|      0|		goto parse_int;
 2307|       |
 2308|      0|	case oCanonicalizeFallbackLocal:
  ------------------
  |  Branch (2308:2): [True: 0, False: 424]
  ------------------
 2309|      0|		intptr = &options->canonicalize_fallback_local;
 2310|      0|		goto parse_flag;
 2311|       |
 2312|      0|	case oStreamLocalBindMask:
  ------------------
  |  Branch (2312:2): [True: 0, False: 424]
  ------------------
 2313|      0|		arg = argv_next(&ac, &av);
 2314|      0|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (2314:7): [True: 0, False: 0]
  |  Branch (2314:15): [True: 0, False: 0]
  ------------------
 2315|      0|			error("%.200s line %d: Missing StreamLocalBindMask "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2316|      0|			    "argument.", filename, linenum);
 2317|      0|			goto out;
 2318|      0|		}
 2319|       |		/* Parse mode in octal format */
 2320|      0|		value = strtol(arg, &endofnumber, 8);
 2321|      0|		if (arg == endofnumber || value < 0 || value > 0777) {
  ------------------
  |  Branch (2321:7): [True: 0, False: 0]
  |  Branch (2321:29): [True: 0, False: 0]
  |  Branch (2321:42): [True: 0, False: 0]
  ------------------
 2322|      0|			error("%.200s line %d: Bad mask.", filename, linenum);
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2323|      0|			goto out;
 2324|      0|		}
 2325|      0|		if (*activep &&
  ------------------
  |  Branch (2325:7): [True: 0, False: 0]
  ------------------
 2326|      0|		    options->fwd_opts.streamlocal_bind_mask == (mode_t)-1)
  ------------------
  |  Branch (2326:7): [True: 0, False: 0]
  ------------------
 2327|      0|			options->fwd_opts.streamlocal_bind_mask = (mode_t)value;
 2328|      0|		break;
 2329|       |
 2330|      0|	case oStreamLocalBindUnlink:
  ------------------
  |  Branch (2330:2): [True: 0, False: 424]
  ------------------
 2331|      0|		intptr = &options->fwd_opts.streamlocal_bind_unlink;
 2332|      0|		goto parse_flag;
 2333|       |
 2334|      5|	case oRevokedHostKeys:
  ------------------
  |  Branch (2334:2): [True: 5, False: 419]
  ------------------
 2335|      5|		uintptr = &options->num_revoked_host_keys;
 2336|      5|		cppptr = &options->revoked_host_keys;
 2337|      5|		found = *uintptr == 0;
 2338|    203|		while ((arg = argv_next(&ac, &av)) != NULL) {
  ------------------
  |  Branch (2338:10): [True: 198, False: 5]
  ------------------
 2339|    198|			if (*arg == '\0') {
  ------------------
  |  Branch (2339:8): [True: 0, False: 198]
  ------------------
 2340|      0|				error("%s line %d: keyword %s empty argument",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2341|      0|				    filename, linenum, keyword);
 2342|      0|				goto out;
 2343|      0|			}
 2344|       |			/* Allow "none" only in first position */
 2345|    198|			if (strcasecmp(arg, "none") == 0) {
  ------------------
  |  Branch (2345:8): [True: 0, False: 198]
  ------------------
 2346|      0|				if (nstrs > 0 || ac > 0) {
  ------------------
  |  Branch (2346:9): [True: 0, False: 0]
  |  Branch (2346:22): [True: 0, False: 0]
  ------------------
 2347|      0|					error("%s line %d: keyword %s \"none\" "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2348|      0|					    "argument must appear alone.",
 2349|      0|					    filename, linenum, keyword);
 2350|      0|					goto out;
 2351|      0|				}
 2352|      0|			}
 2353|    198|			opt_array_append(filename, linenum, keyword,
 2354|    198|			    &strs, &nstrs, arg);
 2355|    198|		}
 2356|      5|		if (nstrs == 0) {
  ------------------
  |  Branch (2356:7): [True: 0, False: 5]
  ------------------
 2357|      0|			fatal("%s line %d: no %s specified",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2358|      0|			    filename, linenum, keyword);
 2359|      0|		}
 2360|      5|		if (found && *activep) {
  ------------------
  |  Branch (2360:7): [True: 5, False: 0]
  |  Branch (2360:16): [True: 5, False: 0]
  ------------------
 2361|      5|			*cppptr = strs;
 2362|      5|			*uintptr = nstrs;
 2363|      5|			strs = NULL; /* transferred */
 2364|      5|			nstrs = 0;
 2365|      5|		}
 2366|      5|		break;
 2367|       |
 2368|      0|	case oFingerprintHash:
  ------------------
  |  Branch (2368:2): [True: 0, False: 424]
  ------------------
 2369|      0|		intptr = &options->fingerprint_hash;
 2370|      0|		arg = argv_next(&ac, &av);
 2371|      0|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (2371:7): [True: 0, False: 0]
  |  Branch (2371:15): [True: 0, False: 0]
  ------------------
 2372|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2373|      0|			    filename, linenum);
 2374|      0|			goto out;
 2375|      0|		}
 2376|      0|		if ((value = ssh_digest_alg_by_name(arg)) == -1) {
  ------------------
  |  Branch (2376:7): [True: 0, False: 0]
  ------------------
 2377|      0|			error("%.200s line %d: Invalid hash algorithm \"%s\".",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2378|      0|			    filename, linenum, arg);
 2379|      0|			goto out;
 2380|      0|		}
 2381|      0|		if (*activep && *intptr == -1)
  ------------------
  |  Branch (2381:7): [True: 0, False: 0]
  |  Branch (2381:19): [True: 0, False: 0]
  ------------------
 2382|      0|			*intptr = value;
 2383|      0|		break;
 2384|       |
 2385|      0|	case oUpdateHostkeys:
  ------------------
  |  Branch (2385:2): [True: 0, False: 424]
  ------------------
 2386|      0|		intptr = &options->update_hostkeys;
 2387|      0|		multistate_ptr = multistate_yesnoask;
 2388|      0|		goto parse_multistate;
 2389|       |
 2390|      0|	case oHostbasedAcceptedAlgorithms:
  ------------------
  |  Branch (2390:2): [True: 0, False: 424]
  ------------------
 2391|      0|		charptr = &options->hostbased_accepted_algos;
 2392|      0|		ca_only = 0;
 2393|      0|		goto parse_pubkey_algos;
 2394|       |
 2395|      0|	case oPubkeyAcceptedAlgorithms:
  ------------------
  |  Branch (2395:2): [True: 0, False: 424]
  ------------------
 2396|      0|		charptr = &options->pubkey_accepted_algos;
 2397|      0|		ca_only = 0;
 2398|      0|		goto parse_pubkey_algos;
 2399|       |
 2400|      1|	case oAddKeysToAgent:
  ------------------
  |  Branch (2400:2): [True: 1, False: 423]
  ------------------
 2401|      1|		arg = argv_next(&ac, &av);
 2402|      1|		arg2 = argv_next(&ac, &av);
 2403|      1|		value = parse_multistate_value(arg, filename, linenum,
 2404|      1|		    multistate_yesnoaskconfirm);
 2405|      1|		value2 = 0; /* unlimited lifespan by default */
 2406|      1|		if (value == 3 && arg2 != NULL) {
  ------------------
  |  Branch (2406:7): [True: 0, False: 1]
  |  Branch (2406:21): [True: 0, False: 0]
  ------------------
 2407|       |			/* allow "AddKeysToAgent confirm 5m" */
 2408|      0|			if ((value2 = convtime(arg2)) == -1) {
  ------------------
  |  Branch (2408:8): [True: 0, False: 0]
  ------------------
 2409|      0|				error("%s line %d: invalid time value.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2410|      0|				    filename, linenum);
 2411|      0|				goto out;
 2412|      0|			}
 2413|      1|		} else if (value == -1 && arg2 == NULL) {
  ------------------
  |  Branch (2413:14): [True: 1, False: 0]
  |  Branch (2413:29): [True: 1, False: 0]
  ------------------
 2414|      1|			if ((value2 = convtime(arg)) == -1) {
  ------------------
  |  Branch (2414:8): [True: 0, False: 1]
  ------------------
 2415|      0|				error("%s line %d: unsupported option",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2416|      0|				    filename, linenum);
 2417|      0|				goto out;
 2418|      0|			}
 2419|      1|			value = 1; /* yes */
 2420|      1|		} else if (value == -1 || arg2 != NULL) {
  ------------------
  |  Branch (2420:14): [True: 0, False: 0]
  |  Branch (2420:29): [True: 0, False: 0]
  ------------------
 2421|      0|			error("%s line %d: unsupported option",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2422|      0|			    filename, linenum);
 2423|      0|			goto out;
 2424|      0|		}
 2425|      1|		if (*activep && options->add_keys_to_agent == -1) {
  ------------------
  |  Branch (2425:7): [True: 1, False: 0]
  |  Branch (2425:19): [True: 1, False: 0]
  ------------------
 2426|      1|			options->add_keys_to_agent = value;
 2427|      1|			options->add_keys_to_agent_lifespan = value2;
 2428|      1|		}
 2429|      1|		break;
 2430|       |
 2431|      0|	case oIdentityAgent:
  ------------------
  |  Branch (2431:2): [True: 0, False: 424]
  ------------------
 2432|      0|		charptr = &options->identity_agent;
 2433|      0|		arg = argv_next(&ac, &av);
 2434|      0|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (2434:7): [True: 0, False: 0]
  |  Branch (2434:15): [True: 0, False: 0]
  ------------------
 2435|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2436|      0|			    filename, linenum);
 2437|      0|			goto out;
 2438|      0|		}
 2439|      0|  parse_agent_path:
 2440|       |		/* Extra validation if the string represents an env var. */
 2441|      0|		if ((arg2 = dollar_expand(&r, arg)) == NULL || r) {
  ------------------
  |  Branch (2441:7): [True: 0, False: 0]
  |  Branch (2441:50): [True: 0, False: 0]
  ------------------
 2442|      0|			error("%.200s line %d: Invalid environment expansion "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2443|      0|			    "%s.", filename, linenum, arg);
 2444|      0|			goto out;
 2445|      0|		}
 2446|      0|		free(arg2);
 2447|       |		/* check for legacy environment format */
 2448|      0|		if (arg[0] == '$' && arg[1] != '{' &&
  ------------------
  |  Branch (2448:7): [True: 0, False: 0]
  |  Branch (2448:24): [True: 0, False: 0]
  ------------------
 2449|      0|		    !valid_env_name(arg + 1)) {
  ------------------
  |  Branch (2449:7): [True: 0, False: 0]
  ------------------
 2450|      0|			error("%.200s line %d: Invalid environment name %s.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2451|      0|			    filename, linenum, arg);
 2452|      0|			goto out;
 2453|      0|		}
 2454|      0|		if (*activep && *charptr == NULL)
  ------------------
  |  Branch (2454:7): [True: 0, False: 0]
  |  Branch (2454:19): [True: 0, False: 0]
  ------------------
 2455|      0|			*charptr = xstrdup(arg);
 2456|      0|		break;
 2457|       |
 2458|      0|	case oEnableEscapeCommandline:
  ------------------
  |  Branch (2458:2): [True: 0, False: 424]
  ------------------
 2459|      0|		intptr = &options->enable_escape_commandline;
 2460|      0|		goto parse_flag;
 2461|       |
 2462|      0|	case oRequiredRSASize:
  ------------------
  |  Branch (2462:2): [True: 0, False: 424]
  ------------------
 2463|      0|		intptr = &options->required_rsa_size;
 2464|      0|		goto parse_int;
 2465|       |
 2466|      0|	case oWarnWeakCrypto:
  ------------------
  |  Branch (2466:2): [True: 0, False: 424]
  ------------------
 2467|      0|		intptr = &options->warn_weak_crypto;
 2468|      0|		multistate_ptr = multistate_warnweakcrypto;
 2469|      0|		goto parse_multistate;
 2470|       |
 2471|      0|	case oObscureKeystrokeTiming:
  ------------------
  |  Branch (2471:2): [True: 0, False: 424]
  ------------------
 2472|      0|		value = -1;
 2473|      0|		while ((arg = argv_next(&ac, &av)) != NULL) {
  ------------------
  |  Branch (2473:10): [True: 0, False: 0]
  ------------------
 2474|      0|			if (value != -1) {
  ------------------
  |  Branch (2474:8): [True: 0, False: 0]
  ------------------
 2475|      0|				error("%s line %d: invalid arguments",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2476|      0|				    filename, linenum);
 2477|      0|				goto out;
 2478|      0|			}
 2479|      0|			if (strcmp(arg, "yes") == 0 ||
  ------------------
  |  Branch (2479:8): [True: 0, False: 0]
  ------------------
 2480|      0|			    strcmp(arg, "true") == 0)
  ------------------
  |  Branch (2480:8): [True: 0, False: 0]
  ------------------
 2481|      0|				value = SSH_KEYSTROKE_DEFAULT_INTERVAL_MS;
  ------------------
  |  |  234|      0|#define SSH_KEYSTROKE_DEFAULT_INTERVAL_MS	20
  ------------------
 2482|      0|			else if (strcmp(arg, "no") == 0 ||
  ------------------
  |  Branch (2482:13): [True: 0, False: 0]
  ------------------
 2483|      0|			    strcmp(arg, "false") == 0)
  ------------------
  |  Branch (2483:8): [True: 0, False: 0]
  ------------------
 2484|      0|				value = 0;
 2485|      0|			else if (strncmp(arg, "interval:", 9) == 0) {
  ------------------
  |  Branch (2485:13): [True: 0, False: 0]
  ------------------
 2486|      0|				if ((errstr = atoi_err(arg + 9,
  ------------------
  |  Branch (2486:9): [True: 0, False: 0]
  ------------------
 2487|      0|				    &value)) != NULL) {
 2488|      0|					error("%s line %d: integer value %s.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2489|      0|					    filename, linenum, errstr);
 2490|      0|					goto out;
 2491|      0|				}
 2492|      0|				if (value <= 0 || value > 1000) {
  ------------------
  |  Branch (2492:9): [True: 0, False: 0]
  |  Branch (2492:23): [True: 0, False: 0]
  ------------------
 2493|      0|					error("%s line %d: value out of range.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2494|      0|					    filename, linenum);
 2495|      0|					goto out;
 2496|      0|				}
 2497|      0|			} else {
 2498|      0|				error("%s line %d: unsupported argument \"%s\"",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2499|      0|				    filename, linenum, arg);
 2500|      0|				goto out;
 2501|      0|			}
 2502|      0|		}
 2503|      0|		if (value == -1) {
  ------------------
  |  Branch (2503:7): [True: 0, False: 0]
  ------------------
 2504|      0|			error("%s line %d: missing argument",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2505|      0|			    filename, linenum);
 2506|      0|			goto out;
 2507|      0|		}
 2508|      0|		intptr = &options->obscure_keystroke_timing_interval;
 2509|      0|		if (*activep && *intptr == -1)
  ------------------
  |  Branch (2509:7): [True: 0, False: 0]
  |  Branch (2509:19): [True: 0, False: 0]
  ------------------
 2510|      0|			*intptr = value;
 2511|      0|		break;
 2512|       |
 2513|      1|	case oChannelTimeout:
  ------------------
  |  Branch (2513:2): [True: 1, False: 423]
  ------------------
 2514|      1|		found = options->num_channel_timeouts == 0;
 2515|      2|		while ((arg = argv_next(&ac, &av)) != NULL) {
  ------------------
  |  Branch (2515:10): [True: 1, False: 1]
  ------------------
 2516|       |			/* Allow "none" only in first position */
 2517|      1|			if (strcasecmp(arg, "none") == 0) {
  ------------------
  |  Branch (2517:8): [True: 0, False: 1]
  ------------------
 2518|      0|				if (nstrs > 0 || ac > 0) {
  ------------------
  |  Branch (2518:9): [True: 0, False: 0]
  |  Branch (2518:22): [True: 0, False: 0]
  ------------------
 2519|      0|					error("%s line %d: keyword %s \"none\" "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2520|      0|					    "argument must appear alone.",
 2521|      0|					    filename, linenum, keyword);
 2522|      0|					goto out;
 2523|      0|				}
 2524|      1|			} else if (parse_pattern_interval(arg,
  ------------------
  |  Branch (2524:15): [True: 0, False: 1]
  ------------------
 2525|      1|			    NULL, NULL) != 0) {
 2526|      0|				fatal("%s line %d: invalid channel timeout %s",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2527|      0|				    filename, linenum, arg);
 2528|      0|			}
 2529|      1|			opt_array_append(filename, linenum, keyword,
 2530|      1|			    &strs, &nstrs, arg);
 2531|      1|		}
 2532|      1|		if (nstrs == 0) {
  ------------------
  |  Branch (2532:7): [True: 0, False: 1]
  ------------------
 2533|      0|			fatal("%s line %d: no %s specified",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2534|      0|			    filename, linenum, keyword);
 2535|      0|		}
 2536|      1|		if (found && *activep) {
  ------------------
  |  Branch (2536:7): [True: 1, False: 0]
  |  Branch (2536:16): [True: 1, False: 0]
  ------------------
 2537|      1|			options->channel_timeouts = strs;
 2538|      1|			options->num_channel_timeouts = nstrs;
 2539|      1|			strs = NULL; /* transferred */
 2540|      1|			nstrs = 0;
 2541|      1|		}
 2542|      1|		break;
 2543|       |
 2544|      0|	case oVersionAddendum:
  ------------------
  |  Branch (2544:2): [True: 0, False: 424]
  ------------------
 2545|      0|		if (str == NULL || *str == '\0')
  ------------------
  |  Branch (2545:7): [True: 0, False: 0]
  |  Branch (2545:22): [True: 0, False: 0]
  ------------------
 2546|      0|			fatal("%s line %d: %s missing argument.",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2547|      0|			    filename, linenum, keyword);
 2548|      0|		len = strspn(str, WHITESPACE);
  ------------------
  |  | 1141|      0|#define WHITESPACE " \t\r\n"
  ------------------
 2549|      0|		if (strchr(str + len, '\r') != NULL) {
  ------------------
  |  Branch (2549:7): [True: 0, False: 0]
  ------------------
 2550|      0|			fatal("%.200s line %d: Invalid %s argument",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2551|      0|			    filename, linenum, keyword);
 2552|      0|		}
 2553|      0|		if ((arg = strchr(line, '#')) != NULL) {
  ------------------
  |  Branch (2553:7): [True: 0, False: 0]
  ------------------
 2554|      0|			*arg = '\0';
 2555|      0|			rtrim(line);
 2556|      0|		}
 2557|      0|		if (*activep && options->version_addendum == NULL) {
  ------------------
  |  Branch (2557:7): [True: 0, False: 0]
  |  Branch (2557:19): [True: 0, False: 0]
  ------------------
 2558|      0|			if (strcasecmp(str + len, "none") == 0)
  ------------------
  |  Branch (2558:8): [True: 0, False: 0]
  ------------------
 2559|      0|				options->version_addendum = xstrdup("");
 2560|      0|			else
 2561|      0|				options->version_addendum = xstrdup(str + len);
 2562|      0|		}
 2563|      0|		argv_consume(&ac);
 2564|      0|		break;
 2565|       |
 2566|      0|	case oRefuseConnection:
  ------------------
  |  Branch (2566:2): [True: 0, False: 424]
  ------------------
 2567|      0|		arg = argv_next(&ac, &av);
 2568|      0|		if (!arg || *arg == '\0') {
  ------------------
  |  Branch (2568:7): [True: 0, False: 0]
  |  Branch (2568:15): [True: 0, False: 0]
  ------------------
 2569|      0|			error("%.200s line %d: Missing argument.",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2570|      0|			    filename, linenum);
 2571|      0|			goto out;
 2572|      0|		}
 2573|      0|		if (*activep) {
  ------------------
  |  Branch (2573:7): [True: 0, False: 0]
  ------------------
 2574|      0|			fatal("%.200s line %d: RefuseConnection: %s",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2575|      0|			    filename, linenum, arg);
 2576|      0|		}
 2577|      0|		break;
 2578|       |
 2579|      0|	case oDeprecated:
  ------------------
  |  Branch (2579:2): [True: 0, False: 424]
  ------------------
 2580|      0|		debug("%s line %d: Deprecated option \"%s\"",
  ------------------
  |  |  111|      0|#define debug(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG1, NULL, __VA_ARGS__)
  ------------------
 2581|      0|		    filename, linenum, keyword);
 2582|      0|		argv_consume(&ac);
 2583|      0|		break;
 2584|       |
 2585|      0|	case oUnsupported:
  ------------------
  |  Branch (2585:2): [True: 0, False: 424]
  ------------------
 2586|      0|		error("%s line %d: Unsupported option \"%s\"",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2587|      0|		    filename, linenum, keyword);
 2588|      0|		argv_consume(&ac);
 2589|      0|		break;
 2590|       |
 2591|      0|	default:
  ------------------
  |  Branch (2591:2): [True: 0, False: 424]
  ------------------
 2592|      0|		error("%s line %d: Unimplemented opcode %d",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2593|      0|		    filename, linenum, opcode);
 2594|      0|		goto out;
 2595|    424|	}
 2596|       |
 2597|       |	/* Check that there is no garbage at end of line. */
 2598|    424|	if (ac > 0) {
  ------------------
  |  Branch (2598:6): [True: 0, False: 424]
  ------------------
 2599|      0|		error("%.200s line %d: keyword %s extra arguments "
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 2600|      0|		    "at end of line", filename, linenum, keyword);
 2601|      0|		goto out;
 2602|      0|	}
 2603|       |
 2604|       |	/* success */
 2605|    424|	ret = 0;
 2606|    424| out:
 2607|    424|	free_canon_cnames(cnames, ncnames);
 2608|       |	opt_array_free2(strs, NULL, nstrs);
 2609|    424|	argv_free(oav, oac);
 2610|    424|	return ret;
 2611|    424|}
readconf.c:parse_token:
  961|    424|{
  962|    424|	int i;
  963|       |
  964|  31.0k|	for (i = 0; keywords[i].name; i++)
  ------------------
  |  Branch (964:14): [True: 31.0k, False: 0]
  ------------------
  965|  31.0k|		if (strcmp(cp, keywords[i].name) == 0)
  ------------------
  |  Branch (965:7): [True: 424, False: 30.6k]
  ------------------
  966|    424|			return keywords[i].opcode;
  967|      0|	if (ignored_unknown != NULL &&
  ------------------
  |  Branch (967:6): [True: 0, False: 0]
  ------------------
  968|      0|	    match_pattern_list(cp, ignored_unknown, 1) == 1)
  ------------------
  |  Branch (968:6): [True: 0, False: 0]
  ------------------
  969|      0|		return oIgnoredUnknownOption;
  970|      0|	error("%s: line %d: Bad configuration option: %s",
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
  971|      0|	    filename, linenum, cp);
  972|      0|	return oBadOption;
  973|      0|}
readconf.c:parse_multistate_value:
 1114|      1|{
 1115|      1|	int i;
 1116|       |
 1117|      1|	if (!arg || *arg == '\0') {
  ------------------
  |  Branch (1117:6): [True: 0, False: 1]
  |  Branch (1117:14): [True: 0, False: 1]
  ------------------
 1118|      0|		error("%s line %d: missing argument.", filename, linenum);
  ------------------
  |  |  114|      0|#define error(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, NULL, __VA_ARGS__)
  ------------------
 1119|      0|		return -1;
 1120|      0|	}
 1121|      7|	for (i = 0; multistate_ptr[i].key != NULL; i++) {
  ------------------
  |  Branch (1121:14): [True: 6, False: 1]
  ------------------
 1122|      6|		if (strcasecmp(arg, multistate_ptr[i].key) == 0)
  ------------------
  |  Branch (1122:7): [True: 0, False: 6]
  ------------------
 1123|      0|			return multistate_ptr[i].value;
 1124|      6|	}
 1125|      1|	return -1;
 1126|      1|}
readconf.c:rm_env:
  928|  2.36k|{
  929|  2.36k|	u_int i, j, onum_send_env = options->num_send_env;
  930|       |
  931|       |	/* Remove an environment variable */
  932|  10.8k|	for (i = 0; i < options->num_send_env; ) {
  ------------------
  |  Branch (932:14): [True: 8.51k, False: 2.36k]
  ------------------
  933|  8.51k|		if (!match_pattern(options->send_env[i], arg + 1)) {
  ------------------
  |  Branch (933:7): [True: 8.12k, False: 395]
  ------------------
  934|  8.12k|			i++;
  935|  8.12k|			continue;
  936|  8.12k|		}
  937|    395|		debug3("%s line %d: removing environment %s",
  ------------------
  |  |  109|    395|#define debug3(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG3, NULL, __VA_ARGS__)
  ------------------
  938|    395|		    filename, linenum, options->send_env[i]);
  939|    395|		free(options->send_env[i]);
  940|    395|		options->send_env[i] = NULL;
  941|    516|		for (j = i; j < options->num_send_env - 1; j++) {
  ------------------
  |  Branch (941:15): [True: 121, False: 395]
  ------------------
  942|    121|			options->send_env[j] = options->send_env[j + 1];
  943|    121|			options->send_env[j + 1] = NULL;
  944|    121|		}
  945|    395|		options->num_send_env--;
  946|       |		/* NB. don't increment i */
  947|    395|	}
  948|  2.36k|	if (onum_send_env != options->num_send_env) {
  ------------------
  |  Branch (948:6): [True: 349, False: 2.01k]
  ------------------
  949|    349|		options->send_env = xrecallocarray(options->send_env,
  950|    349|		    onum_send_env, options->num_send_env,
  951|    349|		    sizeof(*options->send_env));
  952|    349|	}
  953|  2.36k|}
readconf.c:expand_match_exec_or_include_path:
  647|    798|{
  648|    798|	char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV];
  649|    798|	char uidstr[32], *conn_hash_hex, *keyalias, *jmphost, *ruser;
  650|    798|	char *host, *ret;
  651|    798|	int port;
  652|       |
  653|    798|	port = options->port <= 0 ? default_ssh_port() : options->port;
  ------------------
  |  Branch (653:9): [True: 789, False: 9]
  ------------------
  654|    798|	ruser = options->user == NULL ? pw->pw_name : options->user;
  ------------------
  |  Branch (654:10): [True: 738, False: 60]
  ------------------
  655|    798|	if (final_pass) {
  ------------------
  |  Branch (655:6): [True: 0, False: 798]
  ------------------
  656|      0|		host = xstrdup(options->hostname);
  657|    798|	} else if (options->hostname != NULL) {
  ------------------
  |  Branch (657:13): [True: 0, False: 798]
  ------------------
  658|       |		/* NB. Please keep in sync with ssh.c:main() */
  659|      0|		host = percent_expand(options->hostname,
  660|      0|		    "h", host_arg, (char *)NULL);
  661|    798|	} else {
  662|    798|		host = xstrdup(host_arg);
  663|    798|	}
  664|    798|	if (gethostname(thishost, sizeof(thishost)) == -1)
  ------------------
  |  Branch (664:6): [True: 0, False: 798]
  ------------------
  665|      0|		fatal("gethostname: %s", strerror(errno));
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
  666|    798|	jmphost = option_clear_or_none(options->jump_host) ?
  ------------------
  |  Branch (666:12): [True: 798, False: 0]
  ------------------
  667|    798|	    "" : options->jump_host;
  668|    798|	strlcpy(shorthost, thishost, sizeof(shorthost));
  669|    798|	shorthost[strcspn(thishost, ".")] = '\0';
  670|    798|	snprintf(portstr, sizeof(portstr), "%d", port);
  671|    798|	snprintf(uidstr, sizeof(uidstr), "%llu",
  672|    798|	    (unsigned long long)pw->pw_uid);
  673|    798|	conn_hash_hex = ssh_connection_hash(thishost, host,
  674|    798|	    portstr, ruser, jmphost);
  675|    798|	keyalias = options->host_key_alias ?  options->host_key_alias : host;
  ------------------
  |  Branch (675:13): [True: 59, False: 739]
  ------------------
  676|       |
  677|    798|	ret = (is_include_path ? percent_dollar_expand : percent_expand)(path,
  ------------------
  |  Branch (677:9): [True: 798, False: 0]
  ------------------
  678|    798|	    "C", conn_hash_hex,
  679|    798|	    "L", shorthost,
  680|    798|	    "d", pw->pw_dir,
  681|    798|	    "h", host,
  682|    798|	    "k", keyalias,
  683|    798|	    "l", thishost,
  684|    798|	    "n", original_host,
  685|    798|	    "p", portstr,
  686|    798|	    "r", ruser,
  687|    798|	    "u", pw->pw_name,
  688|    798|	    "i", uidstr,
  689|    798|	    "j", jmphost,
  690|       |	    (char *)NULL);
  691|    798|	free(host);
  692|    798|	free(conn_hash_hex);
  693|    798|	return ret;
  694|    798|}
readconf.c:free_canon_cnames:
  977|    424|{
  978|    424|	u_int i;
  979|       |
  980|    424|	if (cnames == NULL || n == 0)
  ------------------
  |  Branch (980:6): [True: 424, False: 0]
  |  Branch (980:24): [True: 0, False: 0]
  ------------------
  981|    424|		return;
  982|      0|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (982:14): [True: 0, False: 0]
  ------------------
  983|      0|		free(cnames[i].source_list);
  984|      0|		free(cnames[i].target_list);
  985|      0|	}
  986|      0|	free(cnames);
  987|      0|}
readconf.c:read_config_file_depth:
 2634|    285|{
 2635|    285|	FILE *f;
 2636|    285|	char *line = NULL;
 2637|    285|	size_t linesize = 0;
 2638|    285|	int linenum;
 2639|    285|	int bad_options = 0;
 2640|       |
 2641|    285|	if (depth < 0 || depth > READCONF_MAX_DEPTH)
  ------------------
  |  | 2629|    285|#define READCONF_MAX_DEPTH	16
  ------------------
  |  Branch (2641:6): [True: 0, False: 285]
  |  Branch (2641:19): [True: 0, False: 285]
  ------------------
 2642|      0|		fatal("Too many recursive configuration includes");
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2643|       |
 2644|    285|	if ((f = fopen(filename, "r")) == NULL)
  ------------------
  |  Branch (2644:6): [True: 0, False: 285]
  ------------------
 2645|      0|		return 0;
 2646|       |
 2647|    285|	if (flags & SSHCONF_CHECKPERM) {
  ------------------
  |  |  219|    285|#define SSHCONF_CHECKPERM	1  /* check permissions on config file */
  ------------------
  |  Branch (2647:6): [True: 0, False: 285]
  ------------------
 2648|      0|		struct stat sb;
 2649|       |
 2650|      0|		if (fstat(fileno(f), &sb) == -1)
  ------------------
  |  Branch (2650:7): [True: 0, False: 0]
  ------------------
 2651|      0|			fatal("fstat %s: %s", filename, strerror(errno));
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2652|      0|		if (((sb.st_uid != 0 && sb.st_uid != getuid()) ||
  ------------------
  |  Branch (2652:9): [True: 0, False: 0]
  |  Branch (2652:27): [True: 0, False: 0]
  ------------------
 2653|      0|		    (sb.st_mode & 022) != 0))
  ------------------
  |  Branch (2653:7): [True: 0, False: 0]
  ------------------
 2654|      0|			fatal("Bad owner or permissions on %s", filename);
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2655|      0|	}
 2656|       |
 2657|    285|	debug("Reading configuration data %.200s", filename);
  ------------------
  |  |  111|    285|#define debug(...)		sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG1, NULL, __VA_ARGS__)
  ------------------
 2658|       |
 2659|       |	/*
 2660|       |	 * Mark that we are now processing the options.  This flag is turned
 2661|       |	 * on/off by Host specifications.
 2662|       |	 */
 2663|    285|	linenum = 0;
 2664|  1.77k|	while (getline(&line, &linesize, f) != -1) {
  ------------------
  |  Branch (2664:9): [True: 1.49k, False: 285]
  ------------------
 2665|       |		/* Update line number counter. */
 2666|  1.49k|		linenum++;
 2667|       |		/*
 2668|       |		 * Trim out comments and strip whitespace.
 2669|       |		 * NB - preserve newlines, they are needed to reproduce
 2670|       |		 * line numbers later for error messages.
 2671|       |		 */
 2672|  1.49k|		if (process_config_line_depth(options, pw, host, original_host,
  ------------------
  |  Branch (2672:7): [True: 0, False: 1.49k]
  ------------------
 2673|  1.49k|		    remote_command, line, filename, linenum, activep, flags,
 2674|  1.49k|		    want_final_pass, depth) != 0)
 2675|      0|			bad_options++;
 2676|  1.49k|	}
 2677|    285|	free(line);
 2678|    285|	fclose(f);
 2679|    285|	if (bad_options > 0)
  ------------------
  |  Branch (2679:6): [True: 0, False: 285]
  ------------------
 2680|      0|		fatal("%s: terminating, %d bad configuration options",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
 2681|    285|		    filename, bad_options);
 2682|    285|	return 1;
 2683|    285|}
readconf.c:parse_fwd_field:
 3234|     10|{
 3235|     10|	char *ep, *cp = *p;
 3236|     10|	int ispath = 0;
 3237|       |
 3238|     10|	if (*cp == '\0') {
  ------------------
  |  Branch (3238:6): [True: 4, False: 6]
  ------------------
 3239|      4|		*p = NULL;
 3240|      4|		return -1;	/* end of string */
 3241|      4|	}
 3242|       |
 3243|       |	/*
 3244|       |	 * A field escaped with square brackets is used literally.
 3245|       |	 * XXX - allow ']' to be escaped via backslash?
 3246|       |	 */
 3247|      6|	if (*cp == '[') {
  ------------------
  |  Branch (3247:6): [True: 0, False: 6]
  ------------------
 3248|       |		/* find matching ']' */
 3249|      0|		for (ep = cp + 1; *ep != ']' && *ep != '\0'; ep++) {
  ------------------
  |  Branch (3249:21): [True: 0, False: 0]
  |  Branch (3249:35): [True: 0, False: 0]
  ------------------
 3250|      0|			if (*ep == '/')
  ------------------
  |  Branch (3250:8): [True: 0, False: 0]
  ------------------
 3251|      0|				ispath = 1;
 3252|      0|		}
 3253|       |		/* no matching ']' or not at end of field. */
 3254|      0|		if (ep[0] != ']' || (ep[1] != ':' && ep[1] != '\0'))
  ------------------
  |  Branch (3254:7): [True: 0, False: 0]
  |  Branch (3254:24): [True: 0, False: 0]
  |  Branch (3254:40): [True: 0, False: 0]
  ------------------
 3255|      0|			return -1;
 3256|       |		/* NUL terminate the field and advance p past the colon */
 3257|      0|		*ep++ = '\0';
 3258|      0|		if (*ep != '\0')
  ------------------
  |  Branch (3258:7): [True: 0, False: 0]
  ------------------
 3259|      0|			*ep++ = '\0';
 3260|      0|		fwd->arg = cp + 1;
 3261|      0|		fwd->ispath = ispath;
 3262|      0|		*p = ep;
 3263|      0|		return 0;
 3264|      0|	}
 3265|       |
 3266|    190|	for (cp = *p; *cp != '\0'; cp++) {
  ------------------
  |  Branch (3266:16): [True: 186, False: 4]
  ------------------
 3267|    186|		switch (*cp) {
  ------------------
  |  Branch (3267:11): [True: 64, False: 122]
  ------------------
 3268|      0|		case '\\':
  ------------------
  |  Branch (3268:3): [True: 0, False: 186]
  ------------------
 3269|      0|			memmove(cp, cp + 1, strlen(cp + 1) + 1);
 3270|      0|			if (*cp == '\0')
  ------------------
  |  Branch (3270:8): [True: 0, False: 0]
  ------------------
 3271|      0|				return -1;
 3272|      0|			break;
 3273|     62|		case '/':
  ------------------
  |  Branch (3273:3): [True: 62, False: 124]
  ------------------
 3274|     62|			ispath = 1;
 3275|     62|			break;
 3276|      2|		case ':':
  ------------------
  |  Branch (3276:3): [True: 2, False: 184]
  ------------------
 3277|      2|			*cp++ = '\0';
 3278|      2|			goto done;
 3279|    186|		}
 3280|    186|	}
 3281|      6|done:
 3282|      6|	fwd->arg = *p;
 3283|      6|	fwd->ispath = ispath;
 3284|      6|	*p = cp;
 3285|      6|	return 0;
 3286|      6|}
readconf.c:lookup_opcode_name:
 3639|    882|{
 3640|    882|	u_int i;
 3641|       |
 3642|  74.0k|	for (i = 0; keywords[i].name != NULL; i++)
  ------------------
  |  Branch (3642:14): [True: 74.0k, False: 0]
  ------------------
 3643|  74.0k|		if (keywords[i].opcode == code)
  ------------------
  |  Branch (3643:7): [True: 882, False: 73.1k]
  ------------------
 3644|    882|			return(keywords[i].name);
 3645|      0|	return "UNKNOWN";
 3646|    882|}

LLVMFuzzerTestOneInput:
   39|    285|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   40|    285|    static int initialized = 0;
   41|    285|    if (!initialized) {
  ------------------
  |  Branch (41:9): [True: 1, False: 284]
  ------------------
   42|      1|        log_init("sshconfig_fuzz", SYSLOG_LEVEL_QUIET, SYSLOG_FACILITY_AUTH, 0);
   43|      1|        init_pw();
   44|      1|        initialized = 1;
   45|      1|    }
   46|       |
   47|       |    // Write fuzz input to a temp file (read_config_file requires a path)
   48|    285|    char tmpfile[] = "/tmp/sshconfig_fuzz_XXXXXX";
   49|    285|    int fd = mkstemp(tmpfile);
  ------------------
  |  |  157|    285|#define mkstemp(x) _ssh_mkstemp(x)
  ------------------
   50|    285|    if (fd < 0)
  ------------------
  |  Branch (50:9): [True: 0, False: 285]
  ------------------
   51|      0|        return 0;
   52|       |
   53|    285|    if (write(fd, data, size) != (ssize_t)size) {
  ------------------
  |  Branch (53:9): [True: 0, False: 285]
  ------------------
   54|      0|        close(fd);
   55|      0|        unlink(tmpfile);
   56|      0|        return 0;
   57|      0|    }
   58|    285|    close(fd);
   59|       |
   60|    285|    Options options;
   61|    285|    initialize_options(&options);
   62|       |
   63|       |    // Process each line through the config parser
   64|       |    // Errors are intentional (fuzzing) — suppress but don't crash
   65|    285|    read_config_file(tmpfile, &fuzz_pw, "fuzz.example.com", "fuzz.example.com",
   66|    285|                     NULL, &options, 0, NULL);
   67|       |
   68|       |    // Clean up allocated options
   69|       |    // (options cleanup is intentionally omitted; leak sanitizer disabled for fuzzing)
   70|       |
   71|    285|    unlink(tmpfile);
   72|    285|    return 0;
   73|    285|}
sshconfig_fuzz.cc:_ZL7init_pwv:
   31|      1|static void init_pw(void) {
   32|      1|    fuzz_pw.pw_name = fuzz_username;
   33|      1|    fuzz_pw.pw_uid = getuid();
   34|      1|    fuzz_pw.pw_gid = getgid();
   35|      1|    fuzz_pw.pw_dir = fuzz_home;
   36|      1|    fuzz_pw.pw_shell = fuzz_shell;
   37|      1|}

sshbuf_put:
  325|    134|{
  326|    134|	u_char *p;
  327|    134|	int r;
  328|       |
  329|    134|	if ((r = sshbuf_reserve(buf, len, &p)) < 0)
  ------------------
  |  Branch (329:6): [True: 0, False: 134]
  ------------------
  330|      0|		return r;
  331|    134|	if (len != 0)
  ------------------
  |  Branch (331:6): [True: 96, False: 38]
  ------------------
  332|     96|		memcpy(p, v, len);
  333|    134|	return 0;
  334|    134|}
sshbuf_put_u8:
  427|  12.2k|{
  428|  12.2k|	u_char *p;
  429|  12.2k|	int r;
  430|       |
  431|  12.2k|	if ((r = sshbuf_reserve(buf, 1, &p)) < 0)
  ------------------
  |  Branch (431:6): [True: 0, False: 12.2k]
  ------------------
  432|      0|		return r;
  433|  12.2k|	p[0] = val;
  434|  12.2k|	return 0;
  435|  12.2k|}

sshbuf_dup_string:
  253|    796|{
  254|    796|	const u_char *p = NULL, *s = sshbuf_ptr(buf);
  255|    796|	size_t l = sshbuf_len(buf);
  256|    796|	char *r;
  257|       |
  258|    796|	if (s == NULL || l >= SIZE_MAX)
  ------------------
  |  Branch (258:6): [True: 0, False: 796]
  |  Branch (258:19): [True: 0, False: 796]
  ------------------
  259|      0|		return NULL;
  260|       |	/* accept a nul only as the last character in the buffer */
  261|    796|	if (l > 0 && (p = memchr(s, '\0', l)) != NULL) {
  ------------------
  |  Branch (261:6): [True: 796, False: 0]
  |  Branch (261:15): [True: 0, False: 796]
  ------------------
  262|      0|		if (p != s + l - 1)
  ------------------
  |  Branch (262:7): [True: 0, False: 0]
  ------------------
  263|      0|			return NULL;
  264|      0|		l--; /* the nul is put back below */
  265|      0|	}
  266|    796|	if ((r = malloc(l + 1)) == NULL)
  ------------------
  |  Branch (266:6): [True: 0, False: 796]
  ------------------
  267|      0|		return NULL;
  268|    796|	if (l > 0)
  ------------------
  |  Branch (268:6): [True: 796, False: 0]
  ------------------
  269|    796|		memcpy(r, s, l);
  270|    796|	r[l] = '\0';
  271|    796|	return r;
  272|    796|}

sshbuf_new:
   94|    802|{
   95|    802|	struct sshbuf *ret;
   96|       |
   97|    802|	if ((ret = calloc(1, sizeof(*ret))) == NULL)
  ------------------
  |  Branch (97:6): [True: 0, False: 802]
  ------------------
   98|      0|		return NULL;
   99|    802|	ret->alloc = SSHBUF_SIZE_INIT;
  ------------------
  |  |  409|    802|# define SSHBUF_SIZE_INIT	256		/* Initial allocation */
  ------------------
  100|    802|	ret->max_size = SSHBUF_SIZE_MAX;
  ------------------
  |  |   39|    802|#define SSHBUF_SIZE_MAX		0x8000000	/* Hard maximum size */
  ------------------
  101|    802|	ret->readonly = 0;
  102|    802|	ret->refcount = 1;
  103|    802|	ret->parent = NULL;
  104|    802|	if ((ret->cd = ret->d = calloc(1, ret->alloc)) == NULL) {
  ------------------
  |  Branch (104:6): [True: 0, False: 802]
  ------------------
  105|      0|		free(ret);
  106|      0|		return NULL;
  107|      0|	}
  108|    802|	return ret;
  109|    802|}
sshbuf_free:
  162|  1.60k|{
  163|  1.60k|	if (buf == NULL)
  ------------------
  |  Branch (163:6): [True: 802, False: 802]
  ------------------
  164|    802|		return;
  165|       |	/*
  166|       |	 * The following will leak on insane buffers, but this is the safest
  167|       |	 * course of action - an invalid pointer or already-freed pointer may
  168|       |	 * have been passed to us and continuing to scribble over memory would
  169|       |	 * be bad.
  170|       |	 */
  171|    802|	if (sshbuf_check_sanity(buf) != 0)
  ------------------
  |  Branch (171:6): [True: 0, False: 802]
  ------------------
  172|      0|		return;
  173|       |
  174|       |	/*
  175|       |	 * If we are a parent with still-extant children, then don't free just
  176|       |	 * yet. The last child's call to sshbuf_free should decrement our
  177|       |	 * refcount to 0 and trigger the actual free.
  178|       |	 */
  179|    802|	buf->refcount--;
  180|    802|	if (buf->refcount > 0)
  ------------------
  |  Branch (180:6): [True: 0, False: 802]
  ------------------
  181|      0|		return;
  182|       |
  183|       |	/*
  184|       |	 * If we are a child, then free our parent to decrement its reference
  185|       |	 * count and possibly free it.
  186|       |	 */
  187|    802|	sshbuf_free(buf->parent);
  188|    802|	buf->parent = NULL;
  189|       |
  190|    802|	if (!buf->readonly)
  ------------------
  |  Branch (190:6): [True: 802, False: 0]
  ------------------
  191|    802|		freezero(buf->d, buf->alloc);
  192|    802|	freezero(buf, sizeof(*buf));
  193|    802|}
sshbuf_len:
  282|    796|{
  283|    796|	if (sshbuf_check_sanity(buf) != 0)
  ------------------
  |  Branch (283:6): [True: 0, False: 796]
  ------------------
  284|      0|		return 0;
  285|    796|	return buf->size - buf->off;
  286|    796|}
sshbuf_ptr:
  298|    796|{
  299|    796|	if (sshbuf_check_sanity(buf) != 0)
  ------------------
  |  Branch (299:6): [True: 0, False: 796]
  ------------------
  300|      0|		return NULL;
  301|    796|	return buf->cd + buf->off;
  302|    796|}
sshbuf_check_reserve:
  314|  12.3k|{
  315|  12.3k|	int r;
  316|       |
  317|  12.3k|	if ((r = sshbuf_check_sanity(buf)) != 0)
  ------------------
  |  Branch (317:6): [True: 0, False: 12.3k]
  ------------------
  318|      0|		return r;
  319|  12.3k|	if (buf->readonly || buf->refcount > 1)
  ------------------
  |  Branch (319:6): [True: 0, False: 12.3k]
  |  Branch (319:23): [True: 0, False: 12.3k]
  ------------------
  320|      0|		return SSH_ERR_BUFFER_READ_ONLY;
  ------------------
  |  |   73|      0|#define SSH_ERR_BUFFER_READ_ONLY		-49
  ------------------
  321|  12.3k|	SSHBUF_TELL("check");
  322|       |	/* Check that len is reasonable and that max_size + available < len */
  323|  12.3k|	if (len > buf->max_size || buf->max_size - len < buf->size - buf->off)
  ------------------
  |  Branch (323:6): [True: 0, False: 12.3k]
  |  Branch (323:29): [True: 0, False: 12.3k]
  ------------------
  324|      0|		return SSH_ERR_NO_BUFFER_SPACE;
  ------------------
  |  |   33|      0|#define SSH_ERR_NO_BUFFER_SPACE			-9
  ------------------
  325|  12.3k|	return 0;
  326|  12.3k|}
sshbuf_allocate:
  330|  12.3k|{
  331|  12.3k|	size_t rlen, need;
  332|  12.3k|	u_char *dp;
  333|  12.3k|	int r;
  334|       |
  335|  12.3k|	SSHBUF_DBG(("allocate buf = %p len = %zu", buf, len));
  336|  12.3k|	if ((r = sshbuf_check_reserve(buf, len)) != 0)
  ------------------
  |  Branch (336:6): [True: 0, False: 12.3k]
  ------------------
  337|      0|		return r;
  338|       |	/*
  339|       |	 * If the requested allocation appended would push us past max_size
  340|       |	 * then pack the buffer, zeroing buf->off.
  341|       |	 */
  342|  12.3k|	sshbuf_maybe_pack(buf, buf->size + len > buf->max_size);
  343|  12.3k|	SSHBUF_TELL("allocate");
  344|  12.3k|	if (len + buf->size <= buf->alloc)
  ------------------
  |  Branch (344:6): [True: 12.3k, False: 5]
  ------------------
  345|  12.3k|		return 0; /* already have it. */
  346|       |
  347|       |	/*
  348|       |	 * Prefer to alloc in SSHBUF_SIZE_INC units, but
  349|       |	 * allocate less if doing so would overflow max_size.
  350|       |	 */
  351|      5|	need = len + buf->size - buf->alloc;
  352|      5|	rlen = ROUNDUP(buf->alloc + need, SSHBUF_SIZE_INC);
  ------------------
  |  |  270|      5|#define ROUNDUP(x, y)   ((((x)+((y)-1))/(y))*(y))
  ------------------
  353|      5|	SSHBUF_DBG(("need %zu initial rlen %zu", need, rlen));
  354|      5|	if (rlen > buf->max_size)
  ------------------
  |  Branch (354:6): [True: 0, False: 5]
  ------------------
  355|      0|		rlen = buf->alloc + need;
  356|      5|	SSHBUF_DBG(("adjusted rlen %zu", rlen));
  357|      5|	if ((dp = recallocarray(buf->d, buf->alloc, rlen, 1)) == NULL) {
  ------------------
  |  Branch (357:6): [True: 0, False: 5]
  ------------------
  358|      0|		SSHBUF_DBG(("realloc fail"));
  359|      0|		return SSH_ERR_ALLOC_FAIL;
  ------------------
  |  |   26|      0|#define SSH_ERR_ALLOC_FAIL			-2
  ------------------
  360|      0|	}
  361|      5|	buf->alloc = rlen;
  362|      5|	buf->cd = buf->d = dp;
  363|      5|	if ((r = sshbuf_check_reserve(buf, len)) < 0) {
  ------------------
  |  Branch (363:6): [True: 0, False: 5]
  ------------------
  364|       |		/* shouldn't fail */
  365|      0|		return r;
  366|      0|	}
  367|      5|	SSHBUF_TELL("done");
  368|      5|	return 0;
  369|      5|}
sshbuf_reserve:
  373|  12.3k|{
  374|  12.3k|	u_char *dp;
  375|  12.3k|	int r;
  376|       |
  377|  12.3k|	if (dpp != NULL)
  ------------------
  |  Branch (377:6): [True: 12.3k, False: 0]
  ------------------
  378|  12.3k|		*dpp = NULL;
  379|       |
  380|  12.3k|	SSHBUF_DBG(("reserve buf = %p len = %zu", buf, len));
  381|  12.3k|	if ((r = sshbuf_allocate(buf, len)) != 0)
  ------------------
  |  Branch (381:6): [True: 0, False: 12.3k]
  ------------------
  382|      0|		return r;
  383|       |
  384|  12.3k|	dp = buf->d + buf->size;
  385|  12.3k|	buf->size += len;
  386|  12.3k|	if (dpp != NULL)
  ------------------
  |  Branch (386:6): [True: 12.3k, False: 0]
  ------------------
  387|  12.3k|		*dpp = dp;
  388|  12.3k|	return 0;
  389|  12.3k|}
sshbuf.c:sshbuf_check_sanity:
   56|  14.7k|{
   57|  14.7k|	SSHBUF_TELL("sanity");
   58|  14.7k|	if (__predict_false(buf == NULL ||
  ------------------
  |  |  986|   294k|#  define __predict_false(exp)    __builtin_expect(((exp) != 0), 0)
  |  |  ------------------
  |  |  |  Branch (986:35): [True: 0, False: 14.7k]
  |  |  |  Branch (986:54): [True: 14.7k, False: 0]
  |  |  |  Branch (986:54): [True: 0, False: 14.7k]
  |  |  |  Branch (986:54): [True: 0, False: 14.7k]
  |  |  |  Branch (986:54): [True: 0, False: 14.7k]
  |  |  |  Branch (986:54): [True: 0, False: 14.7k]
  |  |  |  Branch (986:54): [True: 0, False: 14.7k]
  |  |  |  Branch (986:54): [True: 0, False: 14.7k]
  |  |  |  Branch (986:54): [True: 0, False: 14.7k]
  |  |  |  Branch (986:54): [True: 0, False: 14.7k]
  |  |  |  Branch (986:54): [True: 0, False: 14.7k]
  |  |  |  Branch (986:54): [True: 0, False: 14.7k]
  |  |  ------------------
  ------------------
   59|  14.7k|	    (!buf->readonly && buf->d != buf->cd) ||
   60|  14.7k|	    buf->parent == buf ||
   61|  14.7k|	    buf->refcount < 1 || buf->refcount > SSHBUF_REFS_MAX ||
   62|  14.7k|	    buf->cd == NULL ||
   63|  14.7k|	    buf->max_size > SSHBUF_SIZE_MAX ||
   64|  14.7k|	    buf->alloc > buf->max_size ||
   65|  14.7k|	    buf->size > buf->alloc ||
   66|  14.7k|	    buf->off > buf->size)) {
   67|       |		/* Do not try to recover from corrupted buffer internals */
   68|      0|		SSHBUF_DBG(("SSH_ERR_INTERNAL_ERROR"));
   69|      0|		ssh_signal(SIGSEGV, SIG_DFL);
   70|      0|		raise(SIGSEGV);
   71|      0|		return SSH_ERR_INTERNAL_ERROR;
  ------------------
  |  |   25|      0|#define SSH_ERR_INTERNAL_ERROR			-1
  ------------------
   72|      0|	}
   73|  14.7k|	return 0;
   74|  14.7k|}
sshbuf.c:sshbuf_maybe_pack:
   78|  12.3k|{
   79|  12.3k|	SSHBUF_DBG(("force %d", force));
   80|  12.3k|	SSHBUF_TELL("pre-pack");
   81|  12.3k|	if (buf->off == 0 || buf->readonly || buf->refcount > 1)
  ------------------
  |  Branch (81:6): [True: 12.3k, False: 0]
  |  Branch (81:23): [True: 0, False: 0]
  |  Branch (81:40): [True: 0, False: 0]
  ------------------
   82|  12.3k|		return;
   83|      0|	if (force ||
  ------------------
  |  Branch (83:6): [True: 0, False: 0]
  ------------------
   84|      0|	    (buf->off >= SSHBUF_PACK_MIN && buf->off >= buf->size / 2)) {
  ------------------
  |  |  411|      0|# define SSHBUF_PACK_MIN	8192		/* Minimum packable offset */
  ------------------
  |  Branch (84:7): [True: 0, False: 0]
  |  Branch (84:38): [True: 0, False: 0]
  ------------------
   85|      0|		memmove(buf->d, buf->d + buf->off, buf->size - buf->off);
   86|      0|		buf->size -= buf->off;
   87|      0|		buf->off = 0;
   88|      0|		SSHBUF_TELL("packed");
   89|      0|	}
   90|      0|}

sshkey_type_from_name:
  250|     20|{
  251|     20|	return type_from_name(name, 0);
  252|     20|}
sshkey_names_valid2:
  345|     20|{
  346|     20|	char *s, *cp, *p;
  347|     20|	const struct sshkey_impl *impl;
  348|     20|	int i, type;
  349|       |
  350|     20|	if (names == NULL || strcmp(names, "") == 0)
  ------------------
  |  Branch (350:6): [True: 0, False: 20]
  |  Branch (350:23): [True: 0, False: 20]
  ------------------
  351|      0|		return 0;
  352|     20|	if ((s = cp = strdup(names)) == NULL)
  ------------------
  |  Branch (352:6): [True: 0, False: 20]
  ------------------
  353|      0|		return 0;
  354|     40|	for ((p = strsep(&cp, ",")); p && *p != '\0';
  ------------------
  |  Branch (354:31): [True: 20, False: 20]
  |  Branch (354:36): [True: 20, False: 0]
  ------------------
  355|     20|	    (p = strsep(&cp, ","))) {
  356|     20|		type = sshkey_type_from_name(p);
  357|     20|		if (type == KEY_UNSPEC) {
  ------------------
  |  Branch (357:7): [True: 20, False: 0]
  ------------------
  358|     20|			if (allow_wildcard) {
  ------------------
  |  Branch (358:8): [True: 20, False: 0]
  ------------------
  359|       |				/*
  360|       |				 * Try matching key types against the string.
  361|       |				 * If any has a positive or negative match then
  362|       |				 * the component is accepted.
  363|       |				 */
  364|     20|				impl = NULL;
  365|     51|				for (i = 0; keyimpls[i] != NULL; i++) {
  ------------------
  |  Branch (365:17): [True: 51, False: 0]
  ------------------
  366|     51|					if (match_pattern_list(
  ------------------
  |  Branch (366:10): [True: 20, False: 31]
  ------------------
  367|     51|					    keyimpls[i]->name, p, 0) != 0) {
  368|     20|						impl = keyimpls[i];
  369|     20|						break;
  370|     20|					}
  371|     51|				}
  372|     20|				if (impl != NULL)
  ------------------
  |  Branch (372:9): [True: 20, False: 0]
  ------------------
  373|     20|					continue;
  374|     20|			}
  375|      0|			free(s);
  376|      0|			return 0;
  377|     20|		} else if (plain_only && sshkey_type_is_cert(type)) {
  ------------------
  |  Branch (377:14): [True: 0, False: 0]
  |  Branch (377:28): [True: 0, False: 0]
  ------------------
  378|      0|			free(s);
  379|      0|			return 0;
  380|      0|		}
  381|     20|	}
  382|     20|	free(s);
  383|     20|	return 1;
  384|     20|}
sshkey.c:type_from_name:
  232|     20|{
  233|     20|	int i;
  234|     20|	const struct sshkey_impl *impl;
  235|       |
  236|    460|	for (i = 0; keyimpls[i] != NULL; i++) {
  ------------------
  |  Branch (236:14): [True: 440, False: 20]
  ------------------
  237|    440|		impl = keyimpls[i];
  238|    440|		if (impl->name != NULL && strcmp(name, impl->name) == 0)
  ------------------
  |  Branch (238:7): [True: 440, False: 0]
  |  Branch (238:29): [True: 0, False: 440]
  ------------------
  239|      0|			return impl->type;
  240|       |		/* Only allow shortname matches for plain key types */
  241|    440|		if (allow_short && !impl->cert && impl->shortname != NULL &&
  ------------------
  |  Branch (241:7): [True: 0, False: 440]
  |  Branch (241:22): [True: 0, False: 0]
  |  Branch (241:37): [True: 0, False: 0]
  ------------------
  242|      0|		    strcasecmp(impl->shortname, name) == 0)
  ------------------
  |  Branch (242:7): [True: 0, False: 0]
  ------------------
  243|      0|			return impl->type;
  244|    440|	}
  245|     20|	return KEY_UNSPEC;
  246|     20|}

xmalloc:
   33|  2.61k|{
   34|  2.61k|	void *ptr;
   35|       |
   36|  2.61k|	if (size == 0)
  ------------------
  |  Branch (36:6): [True: 0, False: 2.61k]
  ------------------
   37|      0|		fatal("xmalloc: zero size");
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
   38|  2.61k|	ptr = malloc(size);
   39|  2.61k|	if (ptr == NULL)
  ------------------
  |  Branch (39:6): [True: 0, False: 2.61k]
  ------------------
   40|      0|		fatal("xmalloc: out of memory (allocating %zu bytes)", size);
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
   41|  2.61k|	return ptr;
   42|  2.61k|}
xcalloc:
   46|  21.6k|{
   47|  21.6k|	void *ptr;
   48|       |
   49|  21.6k|	if (size == 0 || nmemb == 0)
  ------------------
  |  Branch (49:6): [True: 0, False: 21.6k]
  |  Branch (49:19): [True: 0, False: 21.6k]
  ------------------
   50|      0|		fatal("xcalloc: zero size");
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
   51|  21.6k|	if (SIZE_MAX / nmemb < size)
  ------------------
  |  Branch (51:6): [True: 0, False: 21.6k]
  ------------------
   52|      0|		fatal("xcalloc: nmemb * size > SIZE_MAX");
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
   53|  21.6k|	ptr = calloc(nmemb, size);
   54|  21.6k|	if (ptr == NULL)
  ------------------
  |  Branch (54:6): [True: 0, False: 21.6k]
  ------------------
   55|      0|		fatal("xcalloc: out of memory (allocating %zu bytes)",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
   56|  21.6k|		    size * nmemb);
   57|  21.6k|	return ptr;
   58|  21.6k|}
xreallocarray:
   62|  5.32k|{
   63|  5.32k|	void *new_ptr;
   64|       |
   65|  5.32k|	new_ptr = reallocarray(ptr, nmemb, size);
   66|  5.32k|	if (new_ptr == NULL)
  ------------------
  |  Branch (66:6): [True: 0, False: 5.32k]
  ------------------
   67|      0|		fatal("xreallocarray: out of memory (%zu elements of %zu bytes)",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
   68|  5.32k|		    nmemb, size);
   69|  5.32k|	return new_ptr;
   70|  5.32k|}
xrecallocarray:
   74|  1.46k|{
   75|  1.46k|	void *new_ptr;
   76|       |
   77|  1.46k|	new_ptr = recallocarray(ptr, onmemb, nmemb, size);
   78|  1.46k|	if (new_ptr == NULL)
  ------------------
  |  Branch (78:6): [True: 0, False: 1.46k]
  ------------------
   79|      0|		fatal("xrecallocarray: out of memory (%zu elements of %zu bytes)",
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
   80|  1.46k|		    nmemb, size);
   81|  1.46k|	return new_ptr;
   82|  1.46k|}
xstrdup:
   86|  2.60k|{
   87|  2.60k|	size_t len;
   88|  2.60k|	char *cp;
   89|       |
   90|  2.60k|	len = strlen(str) + 1;
   91|  2.60k|	cp = xmalloc(len);
   92|  2.60k|	return memcpy(cp, str, len);
   93|  2.60k|}
xvasprintf:
   97|    738|{
   98|    738|	int i;
   99|       |
  100|    738|	i = vasprintf(ret, fmt, ap);
  101|    738|	if (i < 0 || *ret == NULL)
  ------------------
  |  Branch (101:6): [True: 0, False: 738]
  |  Branch (101:15): [True: 0, False: 738]
  ------------------
  102|      0|		fatal("xvasprintf: could not allocate memory");
  ------------------
  |  |  115|      0|#define fatal(...)		sshfatal(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_FATAL, NULL, __VA_ARGS__)
  ------------------
  103|    738|	return i;
  104|    738|}
xasprintf:
  108|    738|{
  109|    738|	va_list ap;
  110|    738|	int i;
  111|       |
  112|    738|	va_start(ap, fmt);
  113|    738|	i = xvasprintf(ret, fmt, ap);
  114|       |	va_end(ap);
  115|    738|	return i;
  116|    738|}

