tmux-3.6-1.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1]
tmux-3.6/arguments.c:500:16: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/arguments.c:499:9: acquire_resource: ‘va_start’ called here
tmux-3.6/arguments.c:500:16: throw: if ‘xvasprintf’ throws an exception...
tmux-3.6/arguments.c:500:16: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  498|   
#  499|   	va_start(ap, fmt);
#  500|-> 	slen = xvasprintf(&s, fmt, ap);
#  501|   	va_end(ap);
#  502|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
tmux-3.6/cfg.c:123:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
tmux-3.6/cfg.c:109:18: acquire_resource: opened here
tmux-3.6/cfg.c:109:12: branch_false: following ‘false’ branch...
tmux-3.6/cfg.c:116:9: branch_false: ...to here
tmux-3.6/cfg.c:123:14: throw: if ‘cmd_parse_from_file’ throws an exception...
tmux-3.6/cfg.c:123:14: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  121|   	pi.c = c;
#  122|   
#  123|-> 	pr = cmd_parse_from_file(f, &pi);
#  124|   	fclose(f);
#  125|   	if (pr->status == CMD_PARSE_ERROR) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
tmux-3.6/cfg.c:123:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
tmux-3.6/cfg.c:109:18: acquire_memory: allocated here
tmux-3.6/cfg.c:109:12: branch_false: following ‘false’ branch...
tmux-3.6/cfg.c:116:9: branch_false: ...to here
tmux-3.6/cfg.c:123:14: throw: if ‘cmd_parse_from_file’ throws an exception...
tmux-3.6/cfg.c:123:14: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  121|   	pi.c = c;
#  122|   
#  123|-> 	pr = cmd_parse_from_file(f, &pi);
#  124|   	fclose(f);
#  125|   	if (pr->status == CMD_PARSE_ERROR) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def4]
tmux-3.6/cfg.c:213:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/cfg.c:212:9: acquire_resource: ‘va_start’ called here
tmux-3.6/cfg.c:213:9: throw: if ‘xvasprintf’ throws an exception...
tmux-3.6/cfg.c:213:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  211|   
#  212|   	va_start(ap, fmt);
#  213|-> 	xvasprintf(&msg, fmt, ap);
#  214|   	va_end(ap);
#  215|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
tmux-3.6/client.c:125:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
tmux-3.6/client.c:115:12: branch_false: following ‘false’ branch (when ‘size <= 107’)...
tmux-3.6/client.c:119:9: branch_false: ...to here
tmux-3.6/client.c:122:19: acquire_resource: stream socket created here
tmux-3.6/client.c:122:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
tmux-3.6/client.c:125:9: branch_false: ...to here
tmux-3.6/client.c:125:9: throw: if ‘log_debug’ throws an exception...
tmux-3.6/client.c:125:9: danger: ‘fd’ leaks here
#  123|   		return (-1);
#  124|   
#  125|-> 	log_debug("trying connect");
#  126|   	if (connect(fd, (struct sockaddr *)&sa, sizeof sa) == -1) {
#  127|   		log_debug("connect failed: %s", strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
tmux-3.6/client.c:126:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
tmux-3.6/client.c:115:12: branch_false: following ‘false’ branch (when ‘size <= 107’)...
tmux-3.6/client.c:119:9: branch_false: ...to here
tmux-3.6/client.c:122:19: acquire_resource: stream socket created here
tmux-3.6/client.c:122:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
tmux-3.6/client.c:125:9: branch_false: ...to here
tmux-3.6/client.c:126:13: throw: if ‘connect’ throws an exception...
tmux-3.6/client.c:126:13: danger: ‘fd’ leaks here
#  124|   
#  125|   	log_debug("trying connect");
#  126|-> 	if (connect(fd, (struct sockaddr *)&sa, sizeof sa) == -1) {
#  127|   		log_debug("connect failed: %s", strerror(errno));
#  128|   		if (errno != ECONNREFUSED && errno != ENOENT)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
tmux-3.6/client.c:479:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
tmux-3.6/client.c:477:19: acquire_resource: opened here
tmux-3.6/client.c:477:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
tmux-3.6/client.c:479:9: branch_false: ...to here
tmux-3.6/client.c:479:9: throw: if ‘proc_send’ throws an exception...
tmux-3.6/client.c:479:9: danger: ‘fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  477|   	if ((fd = dup(STDIN_FILENO)) == -1)
#  478|   		fatal("dup failed");
#  479|-> 	proc_send(client_peer, MSG_IDENTIFY_STDIN, fd, NULL, 0);
#  480|   	if ((fd = dup(STDOUT_FILENO)) == -1)
#  481|   		fatal("dup failed");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
tmux-3.6/client.c:482:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
tmux-3.6/client.c:477:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
tmux-3.6/client.c:479:9: branch_false: ...to here
tmux-3.6/client.c:480:19: acquire_resource: opened here
tmux-3.6/client.c:480:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
tmux-3.6/client.c:482:9: branch_false: ...to here
tmux-3.6/client.c:482:9: throw: if ‘proc_send’ throws an exception...
tmux-3.6/client.c:482:9: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  480|   	if ((fd = dup(STDOUT_FILENO)) == -1)
#  481|   		fatal("dup failed");
#  482|-> 	proc_send(client_peer, MSG_IDENTIFY_STDOUT, fd, NULL, 0);
#  483|   
#  484|   	pid = getpid();

Error: COMPILER_WARNING (CWE-252): [#def9]
tmux-3.6/client.c: scope_hint: In function ‘client_dispatch_attached’
tmux-3.6/client.c:805:17: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’
#  805 |                 system(data);
#      |                 ^~~~~~~~~~~~
#  803|   			fatalx("bad MSG_LOCK string");
#  804|   
#  805|-> 		system(data);
#  806|   		proc_send(client_peer, MSG_UNLOCK, -1, NULL, 0);
#  807|   		break;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def10]
tmux-3.6/cmd-capture-pane.c:69:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘line’
tmux-3.6/cmd-capture-pane.c:75:1: enter_function: entry to ‘cmd_capture_pane_pending’
tmux-3.6/cmd-capture-pane.c:84:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-capture-pane.c:87:16: branch_false: ...to here
tmux-3.6/cmd-capture-pane.c:91:12: branch_true: following ‘true’ branch...
tmux-3.6/cmd-capture-pane.c:91:12: branch_true: ...to here
tmux-3.6/cmd-capture-pane.c:92:29: branch_true: following ‘true’ branch...
tmux-3.6/cmd-capture-pane.c:93:33: branch_true: ...to here
tmux-3.6/cmd-capture-pane.c:93:28: branch_true: following ‘true’ branch...
tmux-3.6/cmd-capture-pane.c:94:33: branch_true: ...to here
tmux-3.6/cmd-capture-pane.c:98:31: call_function: calling ‘cmd_capture_pane_append’ from ‘cmd_capture_pane_pending’
#   67|   {
#   68|   	buf = xrealloc(buf, *len + linelen + 1);
#   69|-> 	memcpy(buf + *len, line, linelen);
#   70|   	*len += linelen;
#   71|   	return (buf);

Error: COMPILER_WARNING (CWE-681): [#def11]
tmux-3.6/cmd-capture-pane.c: scope_hint: In function ‘cmd_capture_pane_pending’
tmux-3.6/cmd-capture-pane.c:87:14: warning[-Wpointer-sign]: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness
#   87 |         line = EVBUFFER_DATA(pending);
#      |              ^
#   85|   		return (xstrdup(""));
#   86|   
#   87|-> 	line = EVBUFFER_DATA(pending);
#   88|   	linelen = EVBUFFER_LENGTH(pending);
#   89|   

Error: COMPILER_WARNING (CWE-457): [#def12]
tmux-3.6/cmd-display-menu.c:513:13: warning[-Wmaybe-uninitialized]: ‘h’ may be used uninitialized
#  513 |         if (popup_display(flags, lines, item, px, py, w, h, env, shellcmd, argc,
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  514 |             argv, cwd, title, tc, s, style, border_style, NULL, NULL) != 0) {
#      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tmux-3.6/cmd-display-menu.c:400:45: note: ‘h’ was declared here
#  400 |         u_int                    px, py, w, h, count = args_count(args);
#      |                                             ^
#  511|   		return (CMD_RETURN_NORMAL);
#  512|   	}
#  513|-> 	if (popup_display(flags, lines, item, px, py, w, h, env, shellcmd, argc,
#  514|   	    argv, cwd, title, tc, s, style, border_style, NULL, NULL) != 0) {
#  515|   		cmd_free_argv(argc, argv);

Error: COMPILER_WARNING (CWE-457): [#def13]
tmux-3.6/cmd-display-menu.c: scope_hint: In function ‘cmd_display_popup_exec’
tmux-3.6/cmd-display-menu.c:513:13: warning[-Wmaybe-uninitialized]: ‘w’ may be used uninitialized
#  513 |         if (popup_display(flags, lines, item, px, py, w, h, env, shellcmd, argc,
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  514 |             argv, cwd, title, tc, s, style, border_style, NULL, NULL) != 0) {
#      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tmux-3.6/cmd-display-menu.c:400:42: note: ‘w’ was declared here
#  400 |         u_int                    px, py, w, h, count = args_count(args);
#      |                                          ^
#  511|   		return (CMD_RETURN_NORMAL);
#  512|   	}
#  513|-> 	if (popup_display(flags, lines, item, px, py, w, h, env, shellcmd, argc,
#  514|   	    argv, cwd, title, tc, s, style, border_style, NULL, NULL) != 0) {
#  515|   		cmd_free_argv(argc, argv);

Error: CPPCHECK_WARNING (CWE-562): [#def14]
tmux-3.6/cmd-find.c:979: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  977|   	} else if (cmd_find_from_client(&current, cmdq_get_client(item),
#  978|   	    flags) == 0) {
#  979|-> 		fs->current = &current;
#  980|   		log_debug("%s: current is from client", __func__);
#  981|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def15]
tmux-3.6/cmd-parse.y:1142:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/cmd-parse.c:1543:1: enter_function: entry to ‘yyparse’
tmux-3.6/cmd-parse.c:1561:8: branch_true: following ‘true’ branch...
tmux-3.6/cmd-parse.c:2248:5: call_function: calling ‘yyerror’ from ‘yyparse’
# 1140|   
# 1141|   	va_start(ap, fmt);
# 1142|-> 	xvasprintf(&error, fmt, ap);
# 1143|   	va_end(ap);
# 1144|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def16]
tmux-3.6/cmd-parse.y:1523:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘tmp’
tmux-3.6/cmd-parse.c:1543:1: enter_function: entry to ‘yyparse’
tmux-3.6/cmd-parse.c:1561:8: branch_false: following ‘false’ branch...
tmux-3.6/cmd-parse.c:1562:5: branch_false: ...to here
tmux-3.6/cmd-parse.c:1567:8: branch_false: following ‘false’ branch (when ‘yyn == 0’)...
tmux-3.6/cmd-parse.c:1568:9: branch_false: ...to here
tmux-3.6/cmd-parse.c:1568:8: branch_true: following ‘true’ branch...
tmux-3.6/cmd-parse.c:1570:23: branch_true: ...to here
tmux-3.6/cmd-parse.c:1570:23: call_function: calling ‘yylex’ from ‘yyparse’
# 1521|   		return (0);
# 1522|   	}
# 1523|-> 	mlen = wctomb(m, tmp);
# 1524|   	if (mlen <= 0 || mlen > (int)sizeof m) {
# 1525|   		yyerror("invalid \\%c argument", type);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
tmux-3.6/cmd-pipe-pane.c:141:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(pipe_fd[1], 0)’
tmux-3.6/cmd-pipe-pane.c:71:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:77:9: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:90:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:112:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:118:14: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:140:20: branch_true: following ‘true’ branch (when ‘out != 0’)...
tmux-3.6/cmd-pipe-pane.c:141:29: branch_true: ...to here
tmux-3.6/cmd-pipe-pane.c:141:29: acquire_resource: opened here
tmux-3.6/cmd-pipe-pane.c:141:28: danger: ‘dup2(pipe_fd[1], 0)’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  139|   		null_fd = open(_PATH_DEVNULL, O_WRONLY);
#  140|   		if (out) {
#  141|-> 			if (dup2(pipe_fd[1], STDIN_FILENO) == -1)
#  142|   				_exit(1);
#  143|   		} else {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def18]
tmux-3.6/cmd-pipe-pane.c:141:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
tmux-3.6/cmd-pipe-pane.c:71:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:77:9: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:90:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:112:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:118:14: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:139:27: acquire_resource: opened here
tmux-3.6/cmd-pipe-pane.c:140:20: branch_true: following ‘true’ branch (when ‘out != 0’)...
tmux-3.6/cmd-pipe-pane.c:141:29: branch_true: ...to here
tmux-3.6/cmd-pipe-pane.c:141:29: danger: ‘open("/dev/null", 1)’ leaks here; was opened at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  139|   		null_fd = open(_PATH_DEVNULL, O_WRONLY);
#  140|   		if (out) {
#  141|-> 			if (dup2(pipe_fd[1], STDIN_FILENO) == -1)
#  142|   				_exit(1);
#  143|   		} else {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
tmux-3.6/cmd-pipe-pane.c:144:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
tmux-3.6/cmd-pipe-pane.c:71:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:77:9: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:90:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:112:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:118:14: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:139:27: acquire_resource: opened here
tmux-3.6/cmd-pipe-pane.c:140:20: branch_false: following ‘false’ branch (when ‘out == 0’)...
tmux-3.6/cmd-pipe-pane.c:144:29: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:144:28: danger: ‘open("/dev/null", 1)’ leaks here; was opened at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#  142|   				_exit(1);
#  143|   		} else {
#  144|-> 			if (dup2(null_fd, STDIN_FILENO) == -1)
#  145|   				_exit(1);
#  146|   		}

Error: GCC_ANALYZER_WARNING: [#def20]
tmux-3.6/cmd-pipe-pane.c:144:29: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘open("/dev/null", 1)’
tmux-3.6/cmd-pipe-pane.c:71:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:77:9: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:90:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:112:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:118:14: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:139:27: acquire_resource: opened here
tmux-3.6/cmd-pipe-pane.c:140:20: branch_false: following ‘false’ branch (when ‘out == 0’)...
tmux-3.6/cmd-pipe-pane.c:144:29: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:144:29: danger: ‘open("/dev/null", 1)’ could be invalid: unchecked value from [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
#  142|   				_exit(1);
#  143|   		} else {
#  144|-> 			if (dup2(null_fd, STDIN_FILENO) == -1)
#  145|   				_exit(1);
#  146|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def21]
tmux-3.6/cmd-pipe-pane.c:148:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(pipe_fd[1], 1)’
tmux-3.6/cmd-pipe-pane.c:71:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:77:9: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:90:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:112:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:118:14: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:144:28: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:147:20: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:147:20: branch_true: following ‘true’ branch (when ‘in != 0’)...
tmux-3.6/cmd-pipe-pane.c:148:29: branch_true: ...to here
tmux-3.6/cmd-pipe-pane.c:148:29: acquire_resource: opened here
tmux-3.6/cmd-pipe-pane.c:148:28: danger: ‘dup2(pipe_fd[1], 1)’ leaks here; was opened at [(13)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/12)
#  146|   		}
#  147|   		if (in) {
#  148|-> 			if (dup2(pipe_fd[1], STDOUT_FILENO) == -1)
#  149|   				_exit(1);
#  150|   			if (pipe_fd[1] != STDOUT_FILENO)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
tmux-3.6/cmd-pipe-pane.c:148:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
tmux-3.6/cmd-pipe-pane.c:71:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:77:9: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:90:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:112:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:118:14: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:139:27: acquire_resource: opened here
tmux-3.6/cmd-pipe-pane.c:144:28: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:147:20: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:147:20: branch_true: following ‘true’ branch (when ‘in != 0’)...
tmux-3.6/cmd-pipe-pane.c:148:29: branch_true: ...to here
tmux-3.6/cmd-pipe-pane.c:148:29: danger: ‘open("/dev/null", 1)’ leaks here; was opened at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
#  146|   		}
#  147|   		if (in) {
#  148|-> 			if (dup2(pipe_fd[1], STDOUT_FILENO) == -1)
#  149|   				_exit(1);
#  150|   			if (pipe_fd[1] != STDOUT_FILENO)

Error: GCC_ANALYZER_WARNING: [#def23]
tmux-3.6/cmd-pipe-pane.c:153:29: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘open("/dev/null", 1)’
tmux-3.6/cmd-pipe-pane.c:71:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:77:9: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:90:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:112:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:118:14: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:139:27: acquire_resource: opened here
tmux-3.6/cmd-pipe-pane.c:141:28: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:147:20: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:147:20: branch_false: following ‘false’ branch (when ‘in == 0’)...
tmux-3.6/cmd-pipe-pane.c:153:29: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:153:29: danger: ‘open("/dev/null", 1)’ could be invalid: unchecked value from [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8)
#  151|   				close(pipe_fd[1]);
#  152|   		} else {
#  153|-> 			if (dup2(null_fd, STDOUT_FILENO) == -1)
#  154|   				_exit(1);
#  155|   		}

Error: GCC_ANALYZER_WARNING: [#def24]
tmux-3.6/cmd-pipe-pane.c:156:21: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘open("/dev/null", 1)’
tmux-3.6/cmd-pipe-pane.c:71:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:77:9: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:90:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:112:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:118:14: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:139:27: acquire_resource: opened here
tmux-3.6/cmd-pipe-pane.c:141:28: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:147:20: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:153:28: branch_false: following ‘false’ branch...
tmux-3.6/cmd-pipe-pane.c:156:21: branch_false: ...to here
tmux-3.6/cmd-pipe-pane.c:156:21: danger: ‘open("/dev/null", 1)’ could be invalid: unchecked value from [(9)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/8)
#  154|   				_exit(1);
#  155|   		}
#  156|-> 		if (dup2(null_fd, STDERR_FILENO) == -1)
#  157|   			_exit(1);
#  158|   		closefrom(STDERR_FILENO + 1);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def25]
tmux-3.6/cmd-queue.c:266:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/cmd-queue.c:730:1: enter_function: entry to ‘cmdq_next’
tmux-3.6/cmd-queue.c:732:42: call_function: inlined call to ‘cmdq_get’ from ‘cmdq_next’
tmux-3.6/cmd-queue.c:732:42: call_function: inlined call to ‘cmdq_get’ from ‘cmdq_next’
tmux-3.6/cmd-queue.c:733:41: call_function: calling ‘cmdq_name’ from ‘cmdq_next’
tmux-3.6/cmd-queue.c:733:41: return_function: returning to ‘cmdq_next’ from ‘cmdq_name’
tmux-3.6/cmd-queue.c:739:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-queue.c:743:13: branch_false: ...to here
tmux-3.6/cmd-queue.c:743:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-queue.c:748:9: branch_false: ...to here
tmux-3.6/cmd-queue.c:751:20: branch_false: following ‘false’ branch...
tmux-3.6/cmd-queue.c:753:17: branch_false: ...to here
tmux-3.6/cmd-queue.c:761:20: branch_false: following ‘false’ branch...
tmux-3.6/cmd-queue.c:768:21: branch_false: ...to here
tmux-3.6/cmd-queue.c:768:20: branch_true: following ‘true’ branch...
tmux-3.6/cmd-queue.c:769:38: branch_true: ...to here
tmux-3.6/cmd-queue.c:774:42: call_function: calling ‘cmdq_fire_command’ from ‘cmdq_next’
#  264|   
#  265|   	va_start(ap, fmt);
#  266|-> 	xvasprintf(&value, fmt, ap);
#  267|   	va_end(ap);
#  268|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def26]
tmux-3.6/cmd-queue.c:380:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/cmd-queue.c:597:1: enter_function: entry to ‘cmdq_fire_command’
tmux-3.6/cmd-queue.c:610:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-queue.c:612:13: branch_false: ...to here
tmux-3.6/cmd-queue.c:643:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-queue.c:645:18: branch_false: ...to here
tmux-3.6/cmd-queue.c:646:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-queue.c:649:18: branch_false: ...to here
tmux-3.6/cmd-queue.c:650:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-queue.c:653:13: branch_false: ...to here
tmux-3.6/cmd-queue.c:653:12: branch_true: following ‘true’ branch...
tmux-3.6/cmd-queue.c:654:21: branch_true: ...to here
tmux-3.6/cmd-queue.c:654:20: branch_true: following ‘true’ branch...
tmux-3.6/cmd-queue.c:662:65: branch_true: ...to here
tmux-3.6/cmd-queue.c:662:17: call_function: calling ‘cmdq_insert_hook’ from ‘cmdq_fire_command’
#  378|   
#  379|   	va_start(ap, fmt);
#  380|-> 	xvasprintf(&name, fmt, ap);
#  381|   	va_end(ap);
#  382|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def27]
tmux-3.6/cmd-queue.c:854:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/cmd-queue.c:850:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-queue.c:853:9: branch_false: ...to here
tmux-3.6/cmd-queue.c:853:9: acquire_resource: ‘va_start’ called here
tmux-3.6/cmd-queue.c:854:9: throw: if ‘evbuffer_add_vprintf’ throws an exception...
tmux-3.6/cmd-queue.c:854:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  852|   
#  853|   	va_start(ap, fmt);
#  854|-> 	evbuffer_add_vprintf(evb, fmt, ap);
#  855|   	va_end(ap);
#  856|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def28]
tmux-3.6/cmd-queue.c:873:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/cmd-queue.c:872:9: acquire_resource: ‘va_start’ called here
tmux-3.6/cmd-queue.c:873:9: throw: if ‘xvasprintf’ throws an exception...
tmux-3.6/cmd-queue.c:873:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  871|   
#  872|   	va_start(ap, fmt);
#  873|-> 	xvasprintf(&msg, fmt, ap);
#  874|   	va_end(ap);
#  875|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def29]
tmux-3.6/cmd-rotate-window.c:74:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘wp’
tmux-3.6/cmd-rotate-window.c:57:12: branch_true: following ‘true’ branch...
tmux-3.6/cmd-rotate-window.c:58:22: branch_true: ...to here
tmux-3.6/cmd-rotate-window.c:66:28: branch_false: following ‘false’ branch (when ‘wp2’ is non-NULL)...
tmux-3.6/cmd-rotate-window.c:68:43: branch_false: ...to here
tmux-3.6/cmd-rotate-window.c:74:17: danger: dereference of NULL ‘wp’
#   72|   			window_pane_resize(wp, wp2->sx, wp2->sy);
#   73|   		}
#   74|-> 		wp->layout_cell = lc;
#   75|   		if (wp->layout_cell != NULL)
#   76|   			wp->layout_cell->wp = wp;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def30]
tmux-3.6/cmd-rotate-window.c:99:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘wp’
tmux-3.6/cmd-rotate-window.c:57:12: branch_false: following ‘false’ branch...
tmux-3.6/cmd-rotate-window.c:83:17: branch_false: ...to here
tmux-3.6/cmd-rotate-window.c:85:17: release_memory: ‘*wp.entry.tqe_next’ is NULL
tmux-3.6/cmd-rotate-window.c:90:17: branch_false: following ‘false’ branch (when ‘wp’ is NULL)...
tmux-3.6/cmd-rotate-window.c:99:17: branch_false: ...to here
tmux-3.6/cmd-rotate-window.c:99:17: danger: dereference of NULL ‘wp’
#   97|   			window_pane_resize(wp, wp2->sx, wp2->sy);
#   98|   		}
#   99|-> 		wp->layout_cell = lc;
#  100|   		if (wp->layout_cell != NULL)
#  101|   			wp->layout_cell->wp = wp;

Error: COMPILER_WARNING (CWE-457): [#def31]
tmux-3.6/cmd-run-shell.c: scope_hint: In function ‘cmd_run_shell_exec’
tmux-3.6/cmd-run-shell.c:172:33: warning[-Wmaybe-uninitialized]: ‘d’ may be used uninitialized
#  172 |                 tv.tv_usec = (d - (double)tv.tv_sec) * 1000000U;
#      |                              ~~~^~~~~~~~~~~~~~~~~~~~
tmux-3.6/cmd-run-shell.c:118:42: note: ‘d’ was declared here
#  118 |         double                           d;
#      |                                          ^
#  170|   		timerclear(&tv);
#  171|   		tv.tv_sec = (time_t)d;
#  172|-> 		tv.tv_usec = (d - (double)tv.tv_sec) * 1000000U;
#  173|   		evtimer_add(&cdata->timer, &tv);
#  174|   	} else

Error: GCC_ANALYZER_WARNING (CWE-404): [#def32]
tmux-3.6/cmd.c:241:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/cmd.c:240:9: acquire_resource: ‘va_start’ called here
tmux-3.6/cmd.c:241:9: throw: if ‘xvasprintf’ throws an exception...
tmux-3.6/cmd.c:241:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  239|   
#  240|   	va_start(ap, fmt);
#  241|-> 	xvasprintf(&prefix, fmt, ap);
#  242|   	va_end(ap);
#  243|   

Error: COMPILER_WARNING (CWE-704): [#def33]
tmux-3.6/compat/getopt_long.c: scope_hint: In function ‘getopt_internal’
tmux-3.6/compat/getopt_long.c:472:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  472 |             (oli = strchr(options, optchar)) == NULL) {
#      |                  ^
#  470|   	if ((optchar = (int)*place++) == (int)':' ||
#  471|   	    (optchar == (int)'-' && *place != '\0') ||
#  472|-> 	    (oli = strchr(options, optchar)) == NULL) {
#  473|   		/*
#  474|   		 * If the user specified "-" and  '-' isn't listed in

Error: COMPILER_WARNING (CWE-704): [#def34]
tmux-3.6/compat/getopt_long.c:472:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  470|   	if ((optchar = (int)*place++) == (int)':' ||
#  471|   	    (optchar == (int)'-' && *place != '\0') ||
#  472|-> 	    (oli = strchr(options, optchar)) == NULL) {
#  473|   		/*
#  474|   		 * If the user specified "-" and  '-' isn't listed in

Error: COMPILER_WARNING (CWE-681): [#def35]
tmux-3.6/compat/getpeereid.c: scope_hint: In function ‘getpeereid’
tmux-3.6/compat/getpeereid.c:36:57: warning[-Wpointer-sign]: pointer targets in passing argument 5 of ‘getsockopt’ differ in signedness
#   36 |         if (getsockopt(s, SOL_SOCKET, SO_PEERCRED, &uc, &len) == -1)
#      |                                                         ^~~~
#      |                                                         |
#      |                                                         int *
tmux-3.6/compat/getpeereid.c:18: included_from: Included from here.
/usr/include/sys/socket.h:257:46: note: expected ‘socklen_t * restrict’ {aka ‘unsigned int * restrict’} but argument is of type ‘int *’
#  257 |                        socklen_t *__restrict __optlen) __THROW;
#      |                        ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
#   34|   	int		len = sizeof uc;
#   35|   
#   36|-> 	if (getsockopt(s, SOL_SOCKET, SO_PEERCRED, &uc, &len) == -1)
#   37|   		return (-1);
#   38|   	*uid = uc.uid;

Error: COMPILER_WARNING (CWE-563): [#def36]
tmux-3.6/compat/imsg-buffer.c: scope_hint: In function ‘msgbuf_clear’
tmux-3.6/compat/imsg-buffer.c:702:26: warning[-Wunused-variable]: unused variable ‘buf’
#  702 |         struct ibuf     *buf;
#      |                          ^~~
#  700|   msgbuf_clear(struct msgbuf *msgbuf)
#  701|   {
#  702|-> 	struct ibuf	*buf;
#  703|   
#  704|   	/* write side */

Error: COMPILER_WARNING: [#def37]
tmux-3.6/compat/vis.c: scope_hint: In function ‘stravis’
tmux-3.6/compat/vis.c:222:23: warning[-Wuse-after-free]: pointer ‘buf_15’ may be used after ‘realloc’
#  222 |                 *outp = buf;
#      |                 ~~~~~~^~~~~
tmux-3.6/compat/vis.c:220:17: note: call to ‘realloc’ here
#  220 |         *outp = realloc(buf, len + 1);
#      |                 ^~~~~~~~~~~~~~~~~~~~~
#  220|   	*outp = realloc(buf, len + 1);
#  221|   	if (*outp == NULL) {
#  222|-> 		*outp = buf;
#  223|   		errno = serrno;
#  224|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def38]
tmux-3.6/control.c:394:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/control.c:1045:1: enter_function: entry to ‘control_check_subs_timer’
tmux-3.6/control.c:1055:9: call_function: inlined call to ‘control_subs_RB_MINMAX’ from ‘control_check_subs_timer’
tmux-3.6/control.c:1055:9: branch_true: following ‘true’ branch (when ‘csub’ is non-NULL)...
tmux-3.6/control.c:1055:9: branch_true: ...to here
tmux-3.6/control.c:1058:25: call_function: calling ‘control_check_subs_session’ from ‘control_check_subs_timer’
#  392|   	char			*s;
#  393|   
#  394|-> 	xvasprintf(&s, fmt, ap);
#  395|   	log_debug("%s: %s: writing line: %s", __func__, c->name, s);
#  396|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def39]
tmux-3.6/control.c:420:14: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/control.c:1045:1: enter_function: entry to ‘control_check_subs_timer’
tmux-3.6/control.c:1055:9: call_function: inlined call to ‘control_subs_RB_MINMAX’ from ‘control_check_subs_timer’
tmux-3.6/control.c:1055:9: branch_true: following ‘true’ branch (when ‘csub’ is non-NULL)...
tmux-3.6/control.c:1055:9: branch_true: ...to here
tmux-3.6/control.c:1058:25: call_function: calling ‘control_check_subs_session’ from ‘control_check_subs_timer’
#  418|   	}
#  419|   
#  420|-> 	cb = xcalloc(1, sizeof *cb);
#  421|   	xvasprintf(&cb->line, fmt, ap);
#  422|   	TAILQ_INSERT_TAIL(&cs->all_blocks, cb, all_entry);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def40]
tmux-3.6/control.c:421:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/control.c:1045:1: enter_function: entry to ‘control_check_subs_timer’
tmux-3.6/control.c:1055:9: call_function: inlined call to ‘control_subs_RB_MINMAX’ from ‘control_check_subs_timer’
tmux-3.6/control.c:1055:9: branch_true: following ‘true’ branch (when ‘csub’ is non-NULL)...
tmux-3.6/control.c:1055:9: branch_true: ...to here
tmux-3.6/control.c:1058:25: call_function: calling ‘control_check_subs_session’ from ‘control_check_subs_timer’
#  419|   
#  420|   	cb = xcalloc(1, sizeof *cb);
#  421|-> 	xvasprintf(&cb->line, fmt, ap);
#  422|   	TAILQ_INSERT_TAIL(&cs->all_blocks, cb, all_entry);
#  423|   	cb->t = get_timer();

Error: GCC_ANALYZER_WARNING (CWE-404): [#def41]
tmux-3.6/environ.c:121:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/environ.c:249:1: enter_function: entry to ‘environ_for_session’
tmux-3.6/environ.c:256:9: call_function: calling ‘environ_copy’ from ‘environ_for_session’
#  119|   		xvasprintf(&envent->value, fmt, ap);
#  120|   	} else {
#  121|-> 		envent = xmalloc(sizeof *envent);
#  122|   		envent->name = xstrdup(name);
#  123|   		envent->flags = flags;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def42]
tmux-3.6/environ.c:122:32: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/environ.c:249:1: enter_function: entry to ‘environ_for_session’
tmux-3.6/environ.c:256:9: call_function: calling ‘environ_copy’ from ‘environ_for_session’
#  120|   	} else {
#  121|   		envent = xmalloc(sizeof *envent);
#  122|-> 		envent->name = xstrdup(name);
#  123|   		envent->flags = flags;
#  124|   		xvasprintf(&envent->value, fmt, ap);

Error: COMPILER_WARNING (CWE-704): [#def43]
tmux-3.6/environ.c: scope_hint: In function ‘environ_put’
tmux-3.6/environ.c:154:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  154 |         value = strchr(var, '=');
#      |               ^
#  152|   	char	*name, *value;
#  153|   
#  154|-> 	value = strchr(var, '=');
#  155|   	if (value == NULL)
#  156|   		return;

Error: COMPILER_WARNING (CWE-704): [#def44]
tmux-3.6/environ.c:154:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  152|   	char	*name, *value;
#  153|   
#  154|-> 	value = strchr(var, '=');
#  155|   	if (value == NULL)
#  156|   		return;

Error: COMPILER_WARNING (CWE-252): [#def45]
tmux-3.6/environ.c: scope_hint: In function ‘environ_log’
tmux-3.6/environ.c:234:9: warning[-Wunused-result]: ignoring return value of ‘vasprintf’ declared with attribute ‘warn_unused_result’
#  234 |         vasprintf(&prefix, fmt, ap);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  232|   
#  233|   	va_start(ap, fmt);
#  234|-> 	vasprintf(&prefix, fmt, ap);
#  235|   	va_end(ap);
#  236|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
tmux-3.6/file.c:765:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor
tmux-3.6/file.c:725:1: enter_function: entry to ‘file_read_open’
tmux-3.6/file.c:737:12: branch_false: following ‘false’ branch (when ‘msglen > 7’)...
tmux-3.6/file.c:739:12: branch_false: ...to here
tmux-3.6/file.c:746:12: branch_false: following ‘false’ branch...
tmux-3.6/file.c:750:14: branch_false: ...to here
tmux-3.6/file.c:750:14: call_function: calling ‘file_create_with_peer’ from ‘file_read_open’
tmux-3.6/file.c:750:14: return_function: returning to ‘file_read_open’ from ‘file_create_with_peer’
tmux-3.6/file.c:751:12: branch_false: following ‘false’ branch...
tmux-3.6/file.c:756:9: branch_false: ...to here
tmux-3.6/file.c:757:12: branch_false: following ‘false’ branch...
tmux-3.6/file.c:759:17: branch_false: ...to here
tmux-3.6/file.c:759:17: branch_true: following ‘true’ branch (when ‘allow_streams != 0’)...
tmux-3.6/file.c:760:20: branch_true: ...to here
tmux-3.6/file.c:760:20: branch_false: following ‘false’ branch...
tmux-3.6/file.c:763:34: branch_false: ...to here
tmux-3.6/file.c:763:34: acquire_resource: opened here
tmux-3.6/file.c:764:28: branch_true: following ‘true’ branch (when ‘close_received != 0’)...
tmux-3.6/file.c:765:33: branch_true: ...to here
tmux-3.6/file.c:765:33: danger: leaks here; was opened at [(25)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/24)
#  763|   			cf->fd = dup(msg->fd);
#  764|   			if (close_received)
#  765|-> 				close(msg->fd); /* can only be used once */
#  766|   		}
#  767|   	} else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
tmux-3.6/file.c:774:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*<unknown>.fd’
tmux-3.6/file.c:725:1: enter_function: entry to ‘file_read_open’
tmux-3.6/file.c:737:12: branch_false: following ‘false’ branch (when ‘msglen > 7’)...
tmux-3.6/file.c:739:12: branch_false: ...to here
tmux-3.6/file.c:746:12: branch_false: following ‘false’ branch...
tmux-3.6/file.c:750:14: branch_false: ...to here
tmux-3.6/file.c:750:14: call_function: calling ‘file_create_with_peer’ from ‘file_read_open’
tmux-3.6/file.c:750:14: return_function: returning to ‘file_read_open’ from ‘file_create_with_peer’
tmux-3.6/file.c:751:12: branch_false: following ‘false’ branch...
tmux-3.6/file.c:756:9: branch_false: ...to here
tmux-3.6/file.c:757:12: branch_true: following ‘true’ branch...
tmux-3.6/file.c:758:26: branch_true: ...to here
tmux-3.6/file.c:758:26: acquire_resource: opened here
tmux-3.6/file.c:769:12: branch_false: following ‘false’ branch...
tmux-3.6/file.c:774:21: branch_false: ...to here
tmux-3.6/file.c:774:21: danger: ‘*<unknown>.fd’ leaks here; was opened at [(21)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/20)
#  772|   	}
#  773|   
#  774|-> 	cf->event = bufferevent_new(cf->fd, file_read_callback, NULL,
#  775|   	    file_read_error_callback, cf);
#  776|   	if (cf->event == NULL)

Error: COMPILER_WARNING (CWE-704): [#def48]
tmux-3.6/format.c: scope_hint: In function ‘format_table_get’
tmux-3.6/format.c:3579:17: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type
# 3579 |         return (bsearch(key, format_table, nitems(format_table),
#      |                 ^~~~~~~
# 3577|   format_table_get(const char *key)
# 3578|   {
# 3579|-> 	return (bsearch(key, format_table, nitems(format_table),
# 3580|   	    sizeof *format_table, format_table_compare));
# 3581|   }

Error: COMPILER_WARNING (CWE-681): [#def49]
tmux-3.6/grid.c: scope_hint: In function ‘grid_string_cells’
tmux-3.6/grid.c:1108:30: warning[-Wpointer-sign]: pointer targets in assignment from ‘u_char *’ {aka ‘unsigned char *’} to ‘const char *’ differ in signedness
# 1108 |                         data = gc.data.data;
#      |                              ^
# 1106|   			size = 1;
# 1107|   		} else {
# 1108|-> 			data = gc.data.data;
# 1109|   			size = gc.data.size;
# 1110|   			if ((flags & GRID_STRING_ESCAPE_SEQUENCES) &&

Error: COMPILER_WARNING (CWE-681): [#def50]
tmux-3.6/input-keys.c: scope_hint: In function ‘input_key_vt10x’
tmux-3.6/input-keys.c:509:50: warning[-Wpointer-sign]: pointer targets in passing argument 3 of ‘input_key_write’ differ in signedness
#  509 |                 input_key_write(__func__, bev, ud.data, ud.size);
#      |                                                ~~^~~~~
#      |                                                  |
#      |                                                  u_char * {aka unsigned char *}
tmux-3.6/input-keys.c:420:72: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  420 | input_key_write(const char *from, struct bufferevent *bev, const char *data,
#      |                                                            ~~~~~~~~~~~~^~~~
#  507|   	if (KEYC_IS_UNICODE(key)) {
#  508|   		utf8_to_data(key, &ud);
#  509|->                 input_key_write(__func__, bev, ud.data, ud.size);
#  510|   		return (0);
#  511|   	}

Error: COMPILER_WARNING (CWE-704): [#def51]
tmux-3.6/input-keys.c:531:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  531 |                 p = strchr(standard_map[0], onlykey);
#      |                   ^
#  529|   	 */
#  530|   	if (key & KEYC_CTRL) {
#  531|-> 		p = strchr(standard_map[0], onlykey);
#  532|   		if (p != NULL)
#  533|   			key = standard_map[1][p - standard_map[0]];

Error: COMPILER_WARNING (CWE-704): [#def52]
tmux-3.6/input-keys.c:531:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  529|   	 */
#  530|   	if (key & KEYC_CTRL) {
#  531|-> 		p = strchr(standard_map[0], onlykey);
#  532|   		if (p != NULL)
#  533|   			key = standard_map[1][p - standard_map[0]];

Error: COMPILER_WARNING (CWE-681): [#def53]
tmux-3.6/input-keys.c:545:40: warning[-Wpointer-sign]: pointer targets in passing argument 3 of ‘input_key_write’ differ in signedness
#  545 |         input_key_write(__func__, bev, &ud.data[0], 1);
#      |                                        ^~~~~~~~~~~
#      |                                        |
#      |                                        u_char * {aka unsigned char *}
tmux-3.6/input-keys.c:420:72: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  420 | input_key_write(const char *from, struct bufferevent *bev, const char *data,
#      |                                                            ~~~~~~~~~~~~^~~~
#  543|   
#  544|   	ud.data[0] = key & 0x7f;
#  545|-> 	input_key_write(__func__, bev, &ud.data[0], 1);
#  546|   	return (0);
#  547|   }

Error: COMPILER_WARNING (CWE-681): [#def54]
tmux-3.6/input-keys.c: scope_hint: In function ‘input_key’
tmux-3.6/input-keys.c:593:48: warning[-Wpointer-sign]: pointer targets in passing argument 3 of ‘input_key_write’ differ in signedness
#  593 |                 input_key_write(__func__, bev, &ud.data[0], 1);
#      |                                                ^~~~~~~~~~~
#      |                                                |
#      |                                                u_char * {aka unsigned char *}
tmux-3.6/input-keys.c:420:72: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  420 | input_key_write(const char *from, struct bufferevent *bev, const char *data,
#      |                                                            ~~~~~~~~~~~~^~~~
#  591|   	if (key & KEYC_LITERAL) {
#  592|   		ud.data[0] = (u_char)key;
#  593|-> 		input_key_write(__func__, bev, &ud.data[0], 1);
#  594|   		return (0);
#  595|   	}

Error: COMPILER_WARNING (CWE-681): [#def55]
tmux-3.6/input-keys.c:616:64: warning[-Wpointer-sign]: pointer targets in passing argument 3 of ‘input_key_write’ differ in signedness
#  616 |                                 input_key_write(__func__, bev, &ud.data[0], 1);
#      |                                                                ^~~~~~~~~~~
#      |                                                                |
#      |                                                                u_char * {aka unsigned char *}
tmux-3.6/input-keys.c:420:72: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  420 | input_key_write(const char *from, struct bufferevent *bev, const char *data,
#      |                                                            ~~~~~~~~~~~~^~~~
#  614|   			}
#  615|   			if (ud.data[0] != 255)
#  616|-> 				input_key_write(__func__, bev, &ud.data[0], 1);
#  617|   			return (0);
#  618|   		}

Error: COMPILER_WARNING (CWE-681): [#def56]
tmux-3.6/input-keys.c:644:56: warning[-Wpointer-sign]: pointer targets in passing argument 3 of ‘input_key_write’ differ in signedness
#  644 |                         input_key_write(__func__, bev, &ud.data[0], 1);
#      |                                                        ^~~~~~~~~~~
#      |                                                        |
#      |                                                        u_char * {aka unsigned char *}
tmux-3.6/input-keys.c:420:72: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  420 | input_key_write(const char *from, struct bufferevent *bev, const char *data,
#      |                                                            ~~~~~~~~~~~~^~~~
#  642|   		    (key >= 0x20 && key <= 0x7f)) {
#  643|   			ud.data[0] = key;
#  644|-> 			input_key_write(__func__, bev, &ud.data[0], 1);
#  645|   			return (0);
#  646|   		}

Error: COMPILER_WARNING (CWE-681): [#def57]
tmux-3.6/input-keys.c:649:58: warning[-Wpointer-sign]: pointer targets in passing argument 3 of ‘input_key_write’ differ in signedness
#  649 |                         input_key_write(__func__, bev, ud.data, ud.size);
#      |                                                        ~~^~~~~
#      |                                                          |
#      |                                                          u_char * {aka unsigned char *}
tmux-3.6/input-keys.c:420:72: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  420 | input_key_write(const char *from, struct bufferevent *bev, const char *data,
#      |                                                            ~~~~~~~~~~~~^~~~
#  647|   		if (KEYC_IS_UNICODE(key)) {
#  648|   			utf8_to_data(key, &ud);
#  649|-> 			input_key_write(__func__, bev, ud.data, ud.size);
#  650|   			return (0);
#  651|   		}

Error: COMPILER_WARNING (CWE-681): [#def58]
tmux-3.6/input-keys.c: scope_hint: In function ‘input_key_get_mouse’
tmux-3.6/input-keys.c:772:69: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_key_split2’ differ in signedness
#  772 |                 len += input_key_split2(m->b + MOUSE_PARAM_BTN_OFF, &buf[len]);
#      |                                                                     ^~~~~~~~~
#      |                                                                     |
#      |                                                                     char *
tmux-3.6/input-keys.c:357:35: note: expected ‘u_char *’ {aka ‘unsigned char *’} but argument is of type ‘char *’
#  357 | input_key_split2(u_int c, u_char *dst)
#      |                           ~~~~~~~~^~~
#  770|   			return (0);
#  771|   		len = xsnprintf(buf, sizeof buf, "\033[M");
#  772|-> 		len += input_key_split2(m->b + MOUSE_PARAM_BTN_OFF, &buf[len]);
#  773|   		len += input_key_split2(x + MOUSE_PARAM_POS_OFF, &buf[len]);
#  774|   		len += input_key_split2(y + MOUSE_PARAM_POS_OFF, &buf[len]);

Error: COMPILER_WARNING (CWE-681): [#def59]
tmux-3.6/input-keys.c:773:66: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_key_split2’ differ in signedness
#  773 |                 len += input_key_split2(x + MOUSE_PARAM_POS_OFF, &buf[len]);
#      |                                                                  ^~~~~~~~~
#      |                                                                  |
#      |                                                                  char *
tmux-3.6/input-keys.c:357:35: note: expected ‘u_char *’ {aka ‘unsigned char *’} but argument is of type ‘char *’
#  357 | input_key_split2(u_int c, u_char *dst)
#      |                           ~~~~~~~~^~~
#  771|   		len = xsnprintf(buf, sizeof buf, "\033[M");
#  772|   		len += input_key_split2(m->b + MOUSE_PARAM_BTN_OFF, &buf[len]);
#  773|-> 		len += input_key_split2(x + MOUSE_PARAM_POS_OFF, &buf[len]);
#  774|   		len += input_key_split2(y + MOUSE_PARAM_POS_OFF, &buf[len]);
#  775|   	} else {

Error: COMPILER_WARNING (CWE-681): [#def60]
tmux-3.6/input-keys.c:774:66: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_key_split2’ differ in signedness
#  774 |                 len += input_key_split2(y + MOUSE_PARAM_POS_OFF, &buf[len]);
#      |                                                                  ^~~~~~~~~
#      |                                                                  |
#      |                                                                  char *
tmux-3.6/input-keys.c:357:35: note: expected ‘u_char *’ {aka ‘unsigned char *’} but argument is of type ‘char *’
#  357 | input_key_split2(u_int c, u_char *dst)
#      |                           ~~~~~~~~^~~
#  772|   		len += input_key_split2(m->b + MOUSE_PARAM_BTN_OFF, &buf[len]);
#  773|   		len += input_key_split2(x + MOUSE_PARAM_POS_OFF, &buf[len]);
#  774|-> 		len += input_key_split2(y + MOUSE_PARAM_POS_OFF, &buf[len]);
#  775|   	} else {
#  776|   		if (m->b + MOUSE_PARAM_BTN_OFF > MOUSE_PARAM_MAX)

Error: COMPILER_WARNING (CWE-681): [#def61]
tmux-3.6/input.c: scope_hint: In function ‘input_table_compare’
tmux-3.6/input.c:774:28: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘strcmp’ differ in signedness
#  774 |         return (strcmp(ictx->interm_buf, entry->interm));
#      |                        ~~~~^~~~~~~~~~~~
#      |                            |
#      |                            const u_char * {aka const unsigned char *}
tmux-3.6/input.c:26: included_from: Included from here.
/usr/include/string.h:171:32: note: expected ‘const char *’ but argument is of type ‘const u_char *’ {aka ‘const unsigned char *’}
#  171 | extern int strcmp (const char *__s1, const char *__s2)
#      |                    ~~~~~~~~~~~~^~~~
#  772|   	if (ictx->ch != entry->ch)
#  773|   		return (ictx->ch - entry->ch);
#  774|-> 	return (strcmp(ictx->interm_buf, entry->interm));
#  775|   }
#  776|   

Error: COMPILER_WARNING (CWE-681): [#def62]
tmux-3.6/input.c: scope_hint: In function ‘input_split’
tmux-3.6/input.c:1081:13: warning[-Wpointer-sign]: pointer targets in assignment from ‘u_char *’ {aka ‘unsigned char *’} to ‘char *’ differ in signedness
# 1081 |         ptr = ictx->param_buf;
#      |             ^
# 1079|   	ip = &ictx->param_list[0];
# 1080|   
# 1081|-> 	ptr = ictx->param_buf;
# 1082|   	while ((out = strsep(&ptr, ";")) != NULL) {
# 1083|   		if (*out == '\0')

Error: GCC_ANALYZER_WARNING (CWE-404): [#def63]
tmux-3.6/input.c:1155:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/input.c:1154:9: acquire_resource: ‘va_start’ called here
tmux-3.6/input.c:1155:9: throw: if ‘xvasprintf’ throws an exception...
tmux-3.6/input.c:1155:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1153|   
# 1154|   	va_start(ap, fmt);
# 1155|-> 	xvasprintf(&reply, fmt, ap);
# 1156|   	va_end(ap);
# 1157|   

Error: COMPILER_WARNING (CWE-704): [#def64]
tmux-3.6/input.c: scope_hint: In function ‘input_esc_dispatch’
tmux-3.6/input.c:1369:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1369 |         entry = bsearch(ictx, input_esc_table, nitems(input_esc_table),
#      |               ^
# 1367|   	log_debug("%s: '%c', %s", __func__, ictx->ch, ictx->interm_buf);
# 1368|   
# 1369|-> 	entry = bsearch(ictx, input_esc_table, nitems(input_esc_table),
# 1370|   	    sizeof input_esc_table[0], input_table_compare);
# 1371|   	if (entry == NULL) {

Error: COMPILER_WARNING (CWE-704): [#def65]
tmux-3.6/input.c:1369:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1367|   	log_debug("%s: '%c', %s", __func__, ictx->ch, ictx->interm_buf);
# 1368|   
# 1369|-> 	entry = bsearch(ictx, input_esc_table, nitems(input_esc_table),
# 1370|   	    sizeof input_esc_table[0], input_table_compare);
# 1371|   	if (entry == NULL) {

Error: COMPILER_WARNING (CWE-704): [#def66]
tmux-3.6/input.c: scope_hint: In function ‘input_csi_dispatch’
tmux-3.6/input.c:1453:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1453 |         entry = bsearch(ictx, input_csi_table, nitems(input_csi_table),
#      |               ^
# 1451|   		return (0);
# 1452|   
# 1453|-> 	entry = bsearch(ictx, input_csi_table, nitems(input_csi_table),
# 1454|   	    sizeof input_csi_table[0], input_table_compare);
# 1455|   	if (entry == NULL) {

Error: COMPILER_WARNING (CWE-704): [#def67]
tmux-3.6/input.c:1453:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1451|   		return (0);
# 1452|   
# 1453|-> 	entry = bsearch(ictx, input_csi_table, nitems(input_csi_table),
# 1454|   	    sizeof input_csi_table[0], input_table_compare);
# 1455|   	if (entry == NULL) {

Error: COMPILER_WARNING (CWE-681): [#def68]
tmux-3.6/input.c: scope_hint: In function ‘input_dcs_dispatch’
tmux-3.6/input.c:2561:34: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘sixel_parse’ differ in signedness
# 2561 |                 si = sixel_parse(buf, len, p2, w->xpixel, w->ypixel);
#      |                                  ^~~
#      |                                  |
#      |                                  u_char * {aka unsigned char *}
tmux-3.6/input.c:29: included_from: Included from here.
tmux-3.6/tmux.h:3644:33: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
# 3644 | struct sixel_image *sixel_parse(const char *, size_t, u_int, u_int, u_int);
#      |                                 ^~~~~~~~~~~~
# 2559|   		if (p2 == -1)
# 2560|   			p2 = 0;
# 2561|-> 		si = sixel_parse(buf, len, p2, w->xpixel, w->ypixel);
# 2562|   		if (si != NULL)
# 2563|   			screen_write_sixelimage(sctx, si, ictx->cell.cell.bg);

Error: COMPILER_WARNING (CWE-681): [#def69]
tmux-3.6/input.c:2585:41: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘strncmp’ differ in signedness
# 2585 |         if (len >= prefixlen && strncmp(buf, prefix, prefixlen) == 0) {
#      |                                         ^~~
#      |                                         |
#      |                                         u_char * {aka unsigned char *}
/usr/include/string.h:174:33: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  174 | extern int strncmp (const char *__s1, const char *__s2, size_t __n)
#      |                     ~~~~~~~~~~~~^~~~
# 2583|   	log_debug("%s: \"%s\"", __func__, buf);
# 2584|   
# 2585|-> 	if (len >= prefixlen && strncmp(buf, prefix, prefixlen) == 0) {
# 2586|   		screen_write_rawstring(sctx, buf + prefixlen, len - prefixlen,
# 2587|   		    allow_passthrough == 2);

Error: COMPILER_WARNING (CWE-681): [#def70]
tmux-3.6/input.c: scope_hint: In function ‘input_exit_osc’
tmux-3.6/input.c:2634:47: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘screen_set_title’ differ in signedness
# 2634 |                     screen_set_title(sctx->s, p)) {
#      |                                               ^
#      |                                               |
#      |                                               u_char * {aka unsigned char *}
tmux-3.6/tmux.h:3193:44: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
# 3193 | int      screen_set_title(struct screen *, const char *);
#      |                                            ^~~~~~~~~~~~
# 2632|   		if (wp != NULL &&
# 2633|   		    options_get_number(wp->options, "allow-set-title") &&
# 2634|-> 		    screen_set_title(sctx->s, p)) {
# 2635|   			notify_pane("pane-title-changed", wp);
# 2636|   			server_redraw_window_borders(wp->window);

Error: COMPILER_WARNING (CWE-681): [#def71]
tmux-3.6/input.c:2641:35: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_osc_4’ differ in signedness
# 2641 |                 input_osc_4(ictx, p);
#      |                                   ^
#      |                                   |
#      |                                   u_char * {aka unsigned char *}
tmux-3.6/input.c:164:49: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  164 | static void     input_osc_4(struct input_ctx *, const char *);
#      |                                                 ^~~~~~~~~~~~
# 2639|   		break;
# 2640|   	case 4:
# 2641|-> 		input_osc_4(ictx, p);
# 2642|   		break;
# 2643|   	case 7:

Error: COMPILER_WARNING (CWE-681): [#def72]
tmux-3.6/input.c:2644:34: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘utf8_isvalid’ differ in signedness
# 2644 |                 if (utf8_isvalid(p)) {
#      |                                  ^
#      |                                  |
#      |                                  u_char * {aka unsigned char *}
tmux-3.6/tmux.h:3529:31: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
# 3529 | int              utf8_isvalid(const char *);
#      |                               ^~~~~~~~~~~~
# 2642|   		break;
# 2643|   	case 7:
# 2644|-> 		if (utf8_isvalid(p)) {
# 2645|   			screen_set_path(sctx->s, p);
# 2646|   			if (wp != NULL) {

Error: COMPILER_WARNING (CWE-681): [#def73]
tmux-3.6/input.c:2645:50: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘screen_set_path’ differ in signedness
# 2645 |                         screen_set_path(sctx->s, p);
#      |                                                  ^
#      |                                                  |
#      |                                                  u_char * {aka unsigned char *}
tmux-3.6/tmux.h:3194:43: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
# 3194 | void     screen_set_path(struct screen *, const char *);
#      |                                           ^~~~~~~~~~~~
# 2643|   	case 7:
# 2644|   		if (utf8_isvalid(p)) {
# 2645|-> 			screen_set_path(sctx->s, p);
# 2646|   			if (wp != NULL) {
# 2647|   				server_redraw_window_borders(wp->window);

Error: COMPILER_WARNING (CWE-681): [#def74]
tmux-3.6/input.c:2653:35: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_osc_8’ differ in signedness
# 2653 |                 input_osc_8(ictx, p);
#      |                                   ^
#      |                                   |
#      |                                   u_char * {aka unsigned char *}
tmux-3.6/input.c:165:49: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  165 | static void     input_osc_8(struct input_ctx *, const char *);
#      |                                                 ^~~~~~~~~~~~
# 2651|   		break;
# 2652|   	case 8:
# 2653|-> 		input_osc_8(ictx, p);
# 2654|   		break;
# 2655|   	case 10:

Error: COMPILER_WARNING (CWE-681): [#def75]
tmux-3.6/input.c:2656:36: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_osc_10’ differ in signedness
# 2656 |                 input_osc_10(ictx, p);
#      |                                    ^
#      |                                    |
#      |                                    u_char * {aka unsigned char *}
tmux-3.6/input.c:166:50: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  166 | static void     input_osc_10(struct input_ctx *, const char *);
#      |                                                  ^~~~~~~~~~~~
# 2654|   		break;
# 2655|   	case 10:
# 2656|-> 		input_osc_10(ictx, p);
# 2657|   		break;
# 2658|   	case 11:

Error: COMPILER_WARNING (CWE-681): [#def76]
tmux-3.6/input.c:2659:36: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_osc_11’ differ in signedness
# 2659 |                 input_osc_11(ictx, p);
#      |                                    ^
#      |                                    |
#      |                                    u_char * {aka unsigned char *}
tmux-3.6/input.c:167:50: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  167 | static void     input_osc_11(struct input_ctx *, const char *);
#      |                                                  ^~~~~~~~~~~~
# 2657|   		break;
# 2658|   	case 11:
# 2659|-> 		input_osc_11(ictx, p);
# 2660|   		break;
# 2661|   	case 12:

Error: COMPILER_WARNING (CWE-681): [#def77]
tmux-3.6/input.c:2662:36: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_osc_12’ differ in signedness
# 2662 |                 input_osc_12(ictx, p);
#      |                                    ^
#      |                                    |
#      |                                    u_char * {aka unsigned char *}
tmux-3.6/input.c:168:50: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  168 | static void     input_osc_12(struct input_ctx *, const char *);
#      |                                                  ^~~~~~~~~~~~
# 2660|   		break;
# 2661|   	case 12:
# 2662|-> 		input_osc_12(ictx, p);
# 2663|   		break;
# 2664|   	case 52:

Error: COMPILER_WARNING (CWE-681): [#def78]
tmux-3.6/input.c:2665:36: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_osc_52’ differ in signedness
# 2665 |                 input_osc_52(ictx, p);
#      |                                    ^
#      |                                    |
#      |                                    u_char * {aka unsigned char *}
tmux-3.6/input.c:169:50: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  169 | static void     input_osc_52(struct input_ctx *, const char *);
#      |                                                  ^~~~~~~~~~~~
# 2663|   		break;
# 2664|   	case 52:
# 2665|-> 		input_osc_52(ictx, p);
# 2666|   		break;
# 2667|   	case 104:

Error: COMPILER_WARNING (CWE-681): [#def79]
tmux-3.6/input.c:2668:37: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_osc_104’ differ in signedness
# 2668 |                 input_osc_104(ictx, p);
#      |                                     ^
#      |                                     |
#      |                                     u_char * {aka unsigned char *}
tmux-3.6/input.c:170:51: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  170 | static void     input_osc_104(struct input_ctx *, const char *);
#      |                                                   ^~~~~~~~~~~~
# 2666|   		break;
# 2667|   	case 104:
# 2668|-> 		input_osc_104(ictx, p);
# 2669|   		break;
# 2670|   	case 110:

Error: COMPILER_WARNING (CWE-681): [#def80]
tmux-3.6/input.c:2671:37: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_osc_110’ differ in signedness
# 2671 |                 input_osc_110(ictx, p);
#      |                                     ^
#      |                                     |
#      |                                     u_char * {aka unsigned char *}
tmux-3.6/input.c:171:51: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  171 | static void     input_osc_110(struct input_ctx *, const char *);
#      |                                                   ^~~~~~~~~~~~
# 2669|   		break;
# 2670|   	case 110:
# 2671|-> 		input_osc_110(ictx, p);
# 2672|   		break;
# 2673|   	case 111:

Error: COMPILER_WARNING (CWE-681): [#def81]
tmux-3.6/input.c:2674:37: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_osc_111’ differ in signedness
# 2674 |                 input_osc_111(ictx, p);
#      |                                     ^
#      |                                     |
#      |                                     u_char * {aka unsigned char *}
tmux-3.6/input.c:172:51: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  172 | static void     input_osc_111(struct input_ctx *, const char *);
#      |                                                   ^~~~~~~~~~~~
# 2672|   		break;
# 2673|   	case 111:
# 2674|-> 		input_osc_111(ictx, p);
# 2675|   		break;
# 2676|   	case 112:

Error: COMPILER_WARNING (CWE-681): [#def82]
tmux-3.6/input.c:2677:37: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_osc_112’ differ in signedness
# 2677 |                 input_osc_112(ictx, p);
#      |                                     ^
#      |                                     |
#      |                                     u_char * {aka unsigned char *}
tmux-3.6/input.c:173:51: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  173 | static void     input_osc_112(struct input_ctx *, const char *);
#      |                                                   ^~~~~~~~~~~~
# 2675|   		break;
# 2676|   	case 112:
# 2677|-> 		input_osc_112(ictx, p);
# 2678|   		break;
# 2679|   	case 133:

Error: COMPILER_WARNING (CWE-681): [#def83]
tmux-3.6/input.c:2680:37: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘input_osc_133’ differ in signedness
# 2680 |                 input_osc_133(ictx, p);
#      |                                     ^
#      |                                     |
#      |                                     u_char * {aka unsigned char *}
tmux-3.6/input.c:174:51: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  174 | static void     input_osc_133(struct input_ctx *, const char *);
#      |                                                   ^~~~~~~~~~~~
# 2678|   		break;
# 2679|   	case 133:
# 2680|-> 		input_osc_133(ictx, p);
# 2681|   		break;
# 2682|   	default:

Error: COMPILER_WARNING (CWE-681): [#def84]
tmux-3.6/input.c: scope_hint: In function ‘input_exit_apc’
tmux-3.6/input.c:2712:43: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘screen_set_title’ differ in signedness
# 2712 |             screen_set_title(sctx->s, ictx->input_buf)) {
#      |                                       ~~~~^~~~~~~~~~~
#      |                                           |
#      |                                           u_char * {aka unsigned char *}
tmux-3.6/tmux.h:3193:44: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
# 3193 | int      screen_set_title(struct screen *, const char *);
#      |                                            ^~~~~~~~~~~~
# 2710|   	if (wp != NULL &&
# 2711|   	    options_get_number(wp->options, "allow-set-title") &&
# 2712|-> 	    screen_set_title(sctx->s, ictx->input_buf)) {
# 2713|   		notify_pane("pane-title-changed", wp);
# 2714|   		server_redraw_window_borders(wp->window);

Error: COMPILER_WARNING (CWE-681): [#def85]
tmux-3.6/input.c: scope_hint: In function ‘input_exit_rename’
tmux-3.6/input.c:2746:31: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘utf8_isvalid’ differ in signedness
# 2746 |         if (!utf8_isvalid(ictx->input_buf))
#      |                           ~~~~^~~~~~~~~~~
#      |                               |
#      |                               u_char * {aka unsigned char *}
tmux-3.6/tmux.h:3529:31: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
# 3529 | int              utf8_isvalid(const char *);
#      |                               ^~~~~~~~~~~~
# 2744|   	log_debug("%s: \"%s\"", __func__, ictx->input_buf);
# 2745|   
# 2746|-> 	if (!utf8_isvalid(ictx->input_buf))
# 2747|   		return;
# 2748|   	w = wp->window;

Error: COMPILER_WARNING (CWE-681): [#def86]
tmux-3.6/input.c:2758:40: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘window_set_name’ differ in signedness
# 2758 |                 window_set_name(w, ictx->input_buf);
#      |                                    ~~~~^~~~~~~~~~~
#      |                                        |
#      |                                        u_char * {aka unsigned char *}
tmux-3.6/tmux.h:3293:51: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
# 3293 | void             window_set_name(struct window *, const char *);
#      |                                                   ^~~~~~~~~~~~
# 2756|   	} else {
# 2757|   		options_set_number(w->options, "automatic-rename", 0);
# 2758|-> 		window_set_name(w, ictx->input_buf);
# 2759|   	}
# 2760|   	server_redraw_window_borders(w);

Error: COMPILER_WARNING (CWE-704): [#def87]
tmux-3.6/input.c: scope_hint: In function ‘input_osc_52’
tmux-3.6/input.c:3094:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 3094 |         if ((end = strchr(p, ';')) == NULL)
#      |                  ^
# 3092|   		return;
# 3093|   
# 3094|-> 	if ((end = strchr(p, ';')) == NULL)
# 3095|   		return;
# 3096|   	end++;

Error: COMPILER_WARNING (CWE-704): [#def88]
tmux-3.6/input.c:3094:18: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 3092|   		return;
# 3093|   
# 3094|-> 	if ((end = strchr(p, ';')) == NULL)
# 3095|   		return;
# 3096|   	end++;

Error: COMPILER_WARNING (CWE-681): [#def89]
tmux-3.6/input.c:3132:25: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘paste_add’ differ in signedness
# 3132 |         paste_add(NULL, out, outlen);
#      |                         ^~~
#      |                         |
#      |                         u_char * {aka unsigned char *}
tmux-3.6/tmux.h:2313:42: note: expected ‘char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
# 2313 | void             paste_add(const char *, char *, size_t);
#      |                                          ^~~~~~
# 3130|   	notify_pane("pane-set-clipboard", wp);
# 3131|   
# 3132|-> 	paste_add(NULL, out, outlen);
# 3133|   }
# 3134|   

Error: COMPILER_WARNING (CWE-681): [#def90]
tmux-3.6/input.c: scope_hint: In function ‘input_reply_clipboard’
tmux-3.6/input.c:3184:40: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘__b64_ntop’ differ in signedness
# 3184 |                 if ((outlen = b64_ntop(buf, len, out, outlen)) == -1) {
#      |                                        ^~~
#      |                                        |
#      |                                        const char *
tmux-3.6/input.c:24: included_from: Included from here.
/usr/include/resolv.h:245:27: note: expected ‘const unsigned char *’ but argument is of type ‘const char *’
#  245 | int             b64_ntop (const unsigned char *, size_t, char *, size_t)
#      |                           ^~~~~~~~~~~~~~~~~~~~~
# 3182|   		outlen = 4 * ((len + 2) / 3) + 1;
# 3183|   		out = xmalloc(outlen);
# 3184|-> 		if ((outlen = b64_ntop(buf, len, out, outlen)) == -1) {
# 3185|   			free(out);
# 3186|   			return;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def91]
tmux-3.6/job.c:157:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(out[1], 0)’
tmux-3.6/job.c:118:20: branch_false: following ‘false’ branch...
tmux-3.6/job.c:120:23: branch_false: ...to here
tmux-3.6/job.c:156:20: branch_true: following ‘true’ branch...
tmux-3.6/job.c:157:29: branch_true: ...to here
tmux-3.6/job.c:157:29: acquire_resource: opened here
tmux-3.6/job.c:157:28: danger: ‘dup2(out[1], 0)’ leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  155|   
#  156|   		if (~flags & JOB_PTY) {
#  157|-> 			if (dup2(out[1], STDIN_FILENO) == -1)
#  158|   				fatal("dup2 failed");
#  159|   			do_close = do_close && out[1] != STDIN_FILENO;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def92]
tmux-3.6/job.c:160:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(out[1], 1)’
tmux-3.6/job.c:118:20: branch_false: following ‘false’ branch...
tmux-3.6/job.c:120:23: branch_false: ...to here
tmux-3.6/job.c:156:20: branch_true: following ‘true’ branch...
tmux-3.6/job.c:157:29: branch_true: ...to here
tmux-3.6/job.c:157:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:159:48: branch_false: ...to here
tmux-3.6/job.c:160:29: acquire_resource: opened here
tmux-3.6/job.c:160:28: danger: ‘dup2(out[1], 1)’ leaks here; was opened at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  158|   				fatal("dup2 failed");
#  159|   			do_close = do_close && out[1] != STDIN_FILENO;
#  160|-> 			if (dup2(out[1], STDOUT_FILENO) == -1)
#  161|   				fatal("dup2 failed");
#  162|   			do_close = do_close && out[1] != STDOUT_FILENO;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def93]
tmux-3.6/job.c:164:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(out[1], 2)’
tmux-3.6/job.c:118:20: branch_false: following ‘false’ branch...
tmux-3.6/job.c:120:23: branch_false: ...to here
tmux-3.6/job.c:156:20: branch_true: following ‘true’ branch...
tmux-3.6/job.c:157:29: branch_true: ...to here
tmux-3.6/job.c:157:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:159:48: branch_false: ...to here
tmux-3.6/job.c:160:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:162:36: branch_false: ...to here
tmux-3.6/job.c:163:28: branch_true: following ‘true’ branch...
tmux-3.6/job.c:164:37: branch_true: ...to here
tmux-3.6/job.c:164:37: acquire_resource: opened here
tmux-3.6/job.c:164:36: danger: ‘dup2(out[1], 2)’ leaks here; was opened at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
#  162|   			do_close = do_close && out[1] != STDOUT_FILENO;
#  163|   			if (flags & JOB_SHOWSTDERR) {
#  164|-> 				if (dup2(out[1], STDERR_FILENO) == -1)
#  165|   					fatal("dup2 failed");
#  166|   				do_close = do_close && out[1] != STDERR_FILENO;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def94]
tmux-3.6/job.c:171:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 2)’
tmux-3.6/job.c:118:20: branch_false: following ‘false’ branch...
tmux-3.6/job.c:120:23: branch_false: ...to here
tmux-3.6/job.c:156:20: branch_true: following ‘true’ branch...
tmux-3.6/job.c:157:29: branch_true: ...to here
tmux-3.6/job.c:157:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:159:48: branch_false: ...to here
tmux-3.6/job.c:160:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:162:36: branch_false: ...to here
tmux-3.6/job.c:163:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:168:42: branch_false: ...to here
tmux-3.6/job.c:169:36: branch_false: following ‘false’ branch...
tmux-3.6/job.c:171:37: branch_false: ...to here
tmux-3.6/job.c:171:37: acquire_resource: opened here
tmux-3.6/job.c:171:36: danger: ‘dup2(open("/dev/null", 2), 2)’ leaks here; was opened at [(15)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/14)
#  169|   				if (nullfd == -1)
#  170|   					fatal("open failed");
#  171|-> 				if (dup2(nullfd, STDERR_FILENO) == -1)
#  172|   					fatal("dup2 failed");
#  173|   				if (nullfd != STDERR_FILENO)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def95]
tmux-3.6/job.c:171:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
tmux-3.6/job.c:118:20: branch_false: following ‘false’ branch...
tmux-3.6/job.c:120:23: branch_false: ...to here
tmux-3.6/job.c:156:20: branch_true: following ‘true’ branch...
tmux-3.6/job.c:157:29: branch_true: ...to here
tmux-3.6/job.c:157:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:159:48: branch_false: ...to here
tmux-3.6/job.c:160:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:162:36: branch_false: ...to here
tmux-3.6/job.c:163:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:168:42: branch_false: ...to here
tmux-3.6/job.c:168:42: acquire_resource: opened here
tmux-3.6/job.c:169:36: branch_false: following ‘false’ branch...
tmux-3.6/job.c:171:37: branch_false: ...to here
tmux-3.6/job.c:171:36: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(13)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/12)
#  169|   				if (nullfd == -1)
#  170|   					fatal("open failed");
#  171|-> 				if (dup2(nullfd, STDERR_FILENO) == -1)
#  172|   					fatal("dup2 failed");
#  173|   				if (nullfd != STDERR_FILENO)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def96]
tmux-3.6/job.c:173:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
tmux-3.6/job.c:118:20: branch_false: following ‘false’ branch...
tmux-3.6/job.c:120:23: branch_false: ...to here
tmux-3.6/job.c:156:20: branch_true: following ‘true’ branch...
tmux-3.6/job.c:157:29: branch_true: ...to here
tmux-3.6/job.c:157:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:159:48: branch_false: ...to here
tmux-3.6/job.c:160:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:162:36: branch_false: ...to here
tmux-3.6/job.c:163:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:168:42: branch_false: ...to here
tmux-3.6/job.c:168:42: acquire_resource: opened here
tmux-3.6/job.c:169:36: branch_false: following ‘false’ branch...
tmux-3.6/job.c:171:37: branch_false: ...to here
tmux-3.6/job.c:171:36: branch_false: following ‘false’ branch...
tmux-3.6/job.c:173:36: branch_false: ...to here
tmux-3.6/job.c:173:36: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(13)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/12)
#  171|   				if (dup2(nullfd, STDERR_FILENO) == -1)
#  172|   					fatal("dup2 failed");
#  173|-> 				if (nullfd != STDERR_FILENO)
#  174|   					close(nullfd);
#  175|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def97]
tmux-3.6/job.c:174:41: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
tmux-3.6/job.c:118:20: branch_false: following ‘false’ branch...
tmux-3.6/job.c:120:23: branch_false: ...to here
tmux-3.6/job.c:156:20: branch_true: following ‘true’ branch...
tmux-3.6/job.c:157:29: branch_true: ...to here
tmux-3.6/job.c:157:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:159:48: branch_false: ...to here
tmux-3.6/job.c:160:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:162:36: branch_false: ...to here
tmux-3.6/job.c:163:28: branch_false: following ‘false’ branch...
tmux-3.6/job.c:168:42: branch_false: ...to here
tmux-3.6/job.c:168:42: acquire_resource: opened here
tmux-3.6/job.c:169:36: branch_false: following ‘false’ branch...
tmux-3.6/job.c:171:37: branch_false: ...to here
tmux-3.6/job.c:171:36: branch_false: following ‘false’ branch...
tmux-3.6/job.c:173:36: branch_false: ...to here
tmux-3.6/job.c:173:36: branch_true: following ‘true’ branch...
tmux-3.6/job.c:174:41: branch_true: ...to here
tmux-3.6/job.c:174:41: danger: ‘open("/dev/null", 2)’ leaks here; was opened at [(13)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/12)
#  172|   					fatal("dup2 failed");
#  173|   				if (nullfd != STDERR_FILENO)
#  174|-> 					close(nullfd);
#  175|   			}
#  176|   			if (do_close)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def98]
tmux-3.6/osdep-linux.c:46:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "r")’
tmux-3.6/osdep-linux.c:38:12: branch_false: following ‘false’ branch (when ‘pgrp != -1’)...
tmux-3.6/osdep-linux.c:41:9: branch_false: ...to here
tmux-3.6/osdep-linux.c:42:18: acquire_resource: opened here
tmux-3.6/osdep-linux.c:42:12: branch_false: following ‘false’ branch...
tmux-3.6/osdep-linux.c:46:9: branch_false: ...to here
tmux-3.6/osdep-linux.c:50:22: throw: if ‘fgetc’ throws an exception...
tmux-3.6/osdep-linux.c:46:9: danger: ‘fopen(path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   44|   		return (NULL);
#   45|   	}
#   46|-> 	free(path);
#   47|   
#   48|   	len = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
tmux-3.6/osdep-linux.c:46:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "r")’
tmux-3.6/osdep-linux.c:38:12: branch_false: following ‘false’ branch (when ‘pgrp != -1’)...
tmux-3.6/osdep-linux.c:41:9: branch_false: ...to here
tmux-3.6/osdep-linux.c:42:18: acquire_memory: allocated here
tmux-3.6/osdep-linux.c:42:12: branch_false: following ‘false’ branch...
tmux-3.6/osdep-linux.c:46:9: branch_false: ...to here
tmux-3.6/osdep-linux.c:50:22: throw: if ‘fgetc’ throws an exception...
tmux-3.6/osdep-linux.c:46:9: danger: ‘fopen(path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   44|   		return (NULL);
#   45|   	}
#   46|-> 	free(path);
#   47|   
#   48|   	len = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def100]
tmux-3.6/popup.c:810:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*(struct popup_editor *)arg.path, "r")’
tmux-3.6/popup.c:808:13: acquire_resource: opened here
tmux-3.6/popup.c:809:12: branch_true: following ‘true’ branch...
tmux-3.6/popup.c:810:17: branch_true: ...to here
tmux-3.6/popup.c:810:17: throw: if ‘fseeko’ throws an exception...
tmux-3.6/popup.c:810:17: danger: ‘fopen(*(struct popup_editor *)arg.path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  808|   	f = fopen(pe->path, "r");
#  809|   	if (f != NULL) {
#  810|-> 		fseeko(f, 0, SEEK_END);
#  811|   		len = ftello(f);
#  812|   		fseeko(f, 0, SEEK_SET);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
tmux-3.6/popup.c:810:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*(struct popup_editor *)arg.path, "r")’
tmux-3.6/popup.c:808:13: acquire_memory: allocated here
tmux-3.6/popup.c:809:12: branch_true: following ‘true’ branch...
tmux-3.6/popup.c:810:17: branch_true: ...to here
tmux-3.6/popup.c:810:17: throw: if ‘fseeko’ throws an exception...
tmux-3.6/popup.c:810:17: danger: ‘fopen(*(struct popup_editor *)arg.path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  808|   	f = fopen(pe->path, "r");
#  809|   	if (f != NULL) {
#  810|-> 		fseeko(f, 0, SEEK_END);
#  811|   		len = ftello(f);
#  812|   		fseeko(f, 0, SEEK_SET);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
tmux-3.6/popup.c:824:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
tmux-3.6/popup.c:809:12: branch_true: following ‘true’ branch...
tmux-3.6/popup.c:810:17: branch_true: ...to here
tmux-3.6/popup.c:814:20: branch_false: following ‘false’ branch...
tmux-3.6/popup.c:816:28: branch_false: ...to here
tmux-3.6/popup.c:816:28: acquire_memory: allocated here
tmux-3.6/popup.c:814:21: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
tmux-3.6/popup.c:817:21: branch_false: ...to here
tmux-3.6/popup.c:814:21: branch_false: following ‘false’ branch...
tmux-3.6/popup.c:822:17: branch_false: ...to here
tmux-3.6/popup.c:824:9: throw: if the called function throws an exception...
tmux-3.6/popup.c:824:9: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  822|   		fclose(f);
#  823|   	}
#  824|-> 	pe->cb(buf, len, pe->arg); /* callback now owns buffer */
#  825|   	popup_editor_free(pe);
#  826|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def103]
tmux-3.6/regsub.c:116:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
tmux-3.6/regsub.c:67:26: release_memory: ‘buf’ is NULL
tmux-3.6/regsub.c:69:12: branch_false: following ‘false’ branch...
tmux-3.6/regsub.c:71:13: branch_false: ...to here
tmux-3.6/regsub.c:71:12: branch_false: following ‘false’ branch...
tmux-3.6/regsub.c:76:15: branch_false: ...to here
tmux-3.6/regsub.c:78:16: branch_false: following ‘false’ branch (when ‘start > end’)...
tmux-3.6/regsub.c:116:12: branch_false: ...to here
tmux-3.6/regsub.c:116:12: release_memory: ‘buf’ is NULL
tmux-3.6/regsub.c:116:9: danger: dereference of NULL ‘buf + (sizetype)len’
#  114|   		}
#  115|   	}
#  116|-> 	buf[len] = '\0';
#  117|   
#  118|   	regfree(&r);

Error: COMPILER_WARNING (CWE-681): [#def104]
tmux-3.6/screen-redraw.c: scope_hint: In function ‘screen_redraw_draw_pane_scrollbar’
tmux-3.6/screen-redraw.c:990:56: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘window_copy_get_current_offset’ differ in signedness
#  990 |                 if (window_copy_get_current_offset(wp, &cm_y, &cm_size) == 0)
#      |                                                        ^~~~~
#      |                                                        |
#      |                                                        int *
tmux-3.6/screen-redraw.c:24: included_from: Included from here.
tmux-3.6/tmux.h:3429:71: note: expected ‘u_int *’ {aka ‘unsigned int *’} but argument is of type ‘int *’
# 3429 | int              window_copy_get_current_offset(struct window_pane *, u_int *,
#      |                                                                       ^~~~~~~
#  988|   		if (TAILQ_FIRST(&wp->modes) == NULL)
#  989|   			return;
#  990|-> 		if (window_copy_get_current_offset(wp, &cm_y, &cm_size) == 0)
#  991|   			return;
#  992|   		total_height = cm_size + sb_h;

Error: COMPILER_WARNING (CWE-681): [#def105]
tmux-3.6/screen-redraw.c:990:63: warning[-Wpointer-sign]: pointer targets in passing argument 3 of ‘window_copy_get_current_offset’ differ in signedness
#  990 |                 if (window_copy_get_current_offset(wp, &cm_y, &cm_size) == 0)
#      |                                                               ^~~~~~~~
#      |                                                               |
#      |                                                               int *
tmux-3.6/tmux.h:3430:22: note: expected ‘u_int *’ {aka ‘unsigned int *’} but argument is of type ‘int *’
# 3430 |                      u_int *);
#      |                      ^~~~~~~
#  988|   		if (TAILQ_FIRST(&wp->modes) == NULL)
#  989|   			return;
#  990|-> 		if (window_copy_get_current_offset(wp, &cm_y, &cm_size) == 0)
#  991|   			return;
#  992|   		total_height = cm_size + sb_h;

Error: COMPILER_WARNING (CWE-681): [#def106]
tmux-3.6/screen-write.c: scope_hint: In function ‘screen_write_strlen’
tmux-3.6/screen-write.c:365:13: warning[-Wpointer-sign]: pointer targets in assignment from ‘char *’ to ‘u_char *’ {aka ‘unsigned char *’} differ in signedness
#  365 |         ptr = msg;
#      |             ^
#  363|   	va_end(ap);
#  364|   
#  365|-> 	ptr = msg;
#  366|   	while (*ptr != '\0') {
#  367|   		if (*ptr > 0x7f && utf8_open(&ud, *ptr) == UTF8_MORE) {

Error: COMPILER_WARNING (CWE-681): [#def107]
tmux-3.6/screen-write.c:370:39: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
#  370 |                         left = strlen(ptr);
#      |                                       ^~~
#      |                                       |
#      |                                       u_char * {aka unsigned char *}
tmux-3.6/screen-write.c:22: included_from: Included from here.
/usr/include/string.h:439:35: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  439 | extern size_t strlen (const char *__s)
#      |                       ~~~~~~~~~~~~^~~
#  368|   			ptr++;
#  369|   
#  370|-> 			left = strlen(ptr);
#  371|   			if (left < (size_t)ud.size - 1)
#  372|   				break;

Error: COMPILER_WARNING (CWE-681): [#def108]
tmux-3.6/screen-write.c: scope_hint: In function ‘screen_write_vnputs’
tmux-3.6/screen-write.c:518:13: warning[-Wpointer-sign]: pointer targets in assignment from ‘char *’ to ‘u_char *’ {aka ‘unsigned char *’} differ in signedness
#  518 |         ptr = msg;
#      |             ^
#  516|   	xvasprintf(&msg, fmt, ap);
#  517|   
#  518|-> 	ptr = msg;
#  519|   	while (*ptr != '\0') {
#  520|   		if (*ptr > 0x7f && utf8_open(ud, *ptr) == UTF8_MORE) {

Error: COMPILER_WARNING (CWE-681): [#def109]
tmux-3.6/screen-write.c:523:39: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
#  523 |                         left = strlen(ptr);
#      |                                       ^~~
#      |                                       |
#      |                                       u_char * {aka unsigned char *}
/usr/include/string.h:439:35: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  439 | extern size_t strlen (const char *__s)
#      |                       ~~~~~~~~~~~~^~~
#  521|   			ptr++;
#  522|   
#  523|-> 			left = strlen(ptr);
#  524|   			if (left < (size_t)ud->size - 1)
#  525|   				break;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def110]
tmux-3.6/server-client.c:616:49: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘line’
tmux-3.6/server-client.c:610:12: branch_false: following ‘false’ branch (when ‘pane_status != 1’)...
tmux-3.6/server-client.c:612:17: branch_false: ...to here
tmux-3.6/server-client.c:612:17: branch_false: following ‘false’ branch (when ‘pane_status != 2’)...
tmux-3.6/server-client.c:616:15: branch_false: ...to here
tmux-3.6/server-client.c:616:49: danger: use of uninitialized value ‘line’ here
#  614|   
#  615|   	/* Check if point is within the pane or scrollbar. */
#  616|-> 	if (((pane_status != PANE_STATUS_OFF && py != line) ||
#  617|   	    (wp->yoff == 0 && py < wp->sy) ||
#  618|   	    (py >= wp->yoff && py < wp->yoff + wp->sy)) &&

Error: COMPILER_WARNING (CWE-457): [#def111]
tmux-3.6/server-client.c:616:52: warning[-Wmaybe-uninitialized]: ‘line’ may be used uninitialized
#  616 |         if (((pane_status != PANE_STATUS_OFF && py != line) ||
#      |                                                 ~~~^~~~~~~
tmux-3.6/server-client.c: scope_hint: In function ‘server_client_key_callback’
tmux-3.6/server-client.c:597:34: note: ‘line’ was declared here
#  597 |         u_int                    line, sl_top, sl_bottom;
#      |                                  ^~~~
#  614|   
#  615|   	/* Check if point is within the pane or scrollbar. */
#  616|-> 	if (((pane_status != PANE_STATUS_OFF && py != line) ||
#  617|   	    (wp->yoff == 0 && py < wp->sy) ||
#  618|   	    (py >= wp->yoff && py < wp->yoff + wp->sy)) &&

Error: GCC_ANALYZER_WARNING (CWE-476): [#def112]
tmux-3.6/server-client.c:2949:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘s’
tmux-3.6/server-client.c:2897:1: enter_function: entry to ‘server_client_reset_state’
tmux-3.6/server-client.c:2901:39: call_function: calling ‘server_client_get_pane’ from ‘server_client_reset_state’
tmux-3.6/server-client.c:2901:39: return_function: returning to ‘server_client_reset_state’ from ‘server_client_get_pane’
tmux-3.6/server-client.c:2907:12: branch_false: following ‘false’ branch...
tmux-3.6/server-client.c:2911:18: branch_false: ...to here
tmux-3.6/server-client.c:2934:12: branch_false: following ‘false’ branch...
tmux-3.6/server-client.c:2946:20: branch_false: ...to here
tmux-3.6/server-client.c:2946:19: branch_true: following ‘true’ branch...
tmux-3.6/server-client.c:2948:17: branch_true: ...to here
tmux-3.6/server-client.c:2949:32: danger: dereference of NULL ‘s’
# 2947|   		cursor = 0;
# 2948|   		tty_window_offset(tty, &ox, &oy, &sx, &sy);
# 2949|-> 		if (wp->xoff + s->cx >= ox && wp->xoff + s->cx <= ox + sx &&
# 2950|   		    wp->yoff + s->cy >= oy && wp->yoff + s->cy <= oy + sy) {
# 2951|   			cursor = 1;

Error: COMPILER_WARNING (CWE-681): [#def113]
tmux-3.6/server-client.c: scope_hint: In function ‘server_client_print’
tmux-3.6/server-client.c:3894:29: warning[-Wpointer-sign]: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness
# 3894 |                         msg = EVBUFFER_DATA(evb);
#      |                             ^
# 3892|   			msg = &empty;
# 3893|   		else {
# 3894|-> 			msg = EVBUFFER_DATA(evb);
# 3895|   			if (msg[size - 1] != '\0')
# 3896|   				evbuffer_add(evb, "", 1);

Error: COMPILER_WARNING (CWE-681): [#def114]
tmux-3.6/server-client.c:3936:30: warning[-Wpointer-sign]: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness
# 3936 |                         line = EVBUFFER_DATA(evb);
#      |                              ^
# 3934|   		size = EVBUFFER_LENGTH(evb);
# 3935|   		if (size != 0) {
# 3936|-> 			line = EVBUFFER_DATA(evb);
# 3937|   			window_copy_add(wp, 1, "%.*s", (int)size, line);
# 3938|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def115]
tmux-3.6/server.c:140:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
tmux-3.6/server.c:117:12: branch_false: following ‘false’ branch (when ‘size <= 107’)...
tmux-3.6/server.c:121:9: branch_false: ...to here
tmux-3.6/server.c:123:19: acquire_resource: stream socket created here
tmux-3.6/server.c:123:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
tmux-3.6/server.c:126:13: branch_false: ...to here
tmux-3.6/server.c:130:12: branch_false: following ‘false’ branch...
tmux-3.6/server.c:136:9: branch_false: ...to here
tmux-3.6/server.c:138:12: branch_true: following ‘true’ branch...
tmux-3.6/server.c:139:31: branch_true: ...to here
tmux-3.6/server.c:140:17: throw: if ‘close’ throws an exception...
tmux-3.6/server.c:140:17: danger: ‘fd’ leaks here
#  138|   	if (listen(fd, 128) == -1) {
#  139|   		saved_errno = errno;
#  140|-> 		close(fd);
#  141|   		errno = saved_errno;
#  142|   		goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def116]
tmux-3.6/server.c:144:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
tmux-3.6/server.c:117:12: branch_false: following ‘false’ branch (when ‘size <= 107’)...
tmux-3.6/server.c:121:9: branch_false: ...to here
tmux-3.6/server.c:123:19: acquire_resource: stream socket created here
tmux-3.6/server.c:123:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
tmux-3.6/server.c:126:13: branch_false: ...to here
tmux-3.6/server.c:130:12: branch_false: following ‘false’ branch...
tmux-3.6/server.c:136:9: branch_false: ...to here
tmux-3.6/server.c:138:12: branch_false: following ‘false’ branch...
tmux-3.6/server.c:144:9: branch_false: ...to here
tmux-3.6/server.c:144:9: throw: if ‘setblocking’ throws an exception...
tmux-3.6/server.c:144:9: danger: ‘fd’ leaks here
#  142|   		goto fail;
#  143|   	}
#  144|-> 	setblocking(fd, 0);
#  145|   
#  146|   	return (fd);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def117]
tmux-3.6/server.c:540:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/server.c:539:9: acquire_resource: ‘va_start’ called here
tmux-3.6/server.c:540:9: throw: if ‘xvasprintf’ throws an exception...
tmux-3.6/server.c:540:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  538|   
#  539|   	va_start(ap, fmt);
#  540|-> 	xvasprintf(&s, fmt, ap);
#  541|   	va_end(ap);
#  542|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def118]
tmux-3.6/status.c:1691:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘list’
tmux-3.6/status.c:1700:1: enter_function: entry to ‘status_prompt_complete_list’
tmux-3.6/status.c:1702:51: release_memory: ‘list’ is NULL
tmux-3.6/status.c:1742:12: branch_false: following ‘false’ branch (when ‘at_start == 0’)...
tmux-3.6/status.c:1742:12: branch_false: ...to here
tmux-3.6/status.c:1744:34: branch_true: following ‘true’ branch...
tmux-3.6/status.c:1745:21: branch_true: ...to here
tmux-3.6/status.c:1745:20: branch_true: following ‘true’ branch...
tmux-3.6/status.c:1746:25: branch_true: ...to here
tmux-3.6/status.c:1746:25: call_function: calling ‘status_prompt_add_list’ from ‘status_prompt_complete_list’
# 1689|   
# 1690|   	for (i = 0; i < *size; i++) {
# 1691|-> 		if (strcmp((*list)[i], s) == 0)
# 1692|   			return;
# 1693|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def119]
tmux-3.6/status.c:2062:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
tmux-3.6/status.c:2009:55: release_memory: ‘out’ is NULL
tmux-3.6/status.c:2043:12: branch_false: following ‘false’ branch...
tmux-3.6/status.c:2048:17: branch_false: ...to here
tmux-3.6/status.c:2051:12: branch_false: following ‘false’ branch (when ‘colon’ is non-NULL)...
tmux-3.6/status.c:2057:13: branch_false: ...to here
tmux-3.6/status.c:2057:12: branch_true: following ‘true’ branch...
tmux-3.6/status.c:2058:21: branch_true: ...to here
tmux-3.6/status.c:2058:20: branch_false: following ‘false’ branch...
tmux-3.6/status.c:2061:32: branch_false: ...to here
tmux-3.6/status.c:2062:25: danger: dereference of NULL ‘strchr(xstrdup(s), 58)’
# 2060|   		else {
# 2061|   			copy = xstrdup(s);
# 2062|-> 			*strchr(copy, ':') = '\0';
# 2063|   			session = session_find(copy);
# 2064|   			free(copy);

Error: COMPILER_WARNING (CWE-681): [#def120]
tmux-3.6/tty-keys.c: scope_hint: In function ‘tty_keys_next’
tmux-3.6/tty-keys.c:745:13: warning[-Wpointer-sign]: pointer targets in assignment from ‘unsigned char *’ to ‘const char *’ differ in signedness
#  745 |         buf = EVBUFFER_DATA(tty->in);
#      |             ^
#  743|   
#  744|   	/* Get key buffer. */
#  745|-> 	buf = EVBUFFER_DATA(tty->in);
#  746|   	len = EVBUFFER_LENGTH(tty->in);
#  747|   	if (len == 0)

Error: COMPILER_WARNING (CWE-681): [#def121]
tmux-3.6/tty-keys.c: scope_hint: In function ‘tty_keys_clipboard’
tmux-3.6/tty-keys.c:1381:38: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘__b64_pton’ differ in signedness
# 1381 |         if ((outlen = b64_pton(copy, out, len)) == -1) {
#      |                                      ^~~
#      |                                      |
#      |                                      char *
tmux-3.6/tty-keys.c:26: included_from: Included from here.
/usr/include/resolv.h:247:41: note: expected ‘unsigned char *’ but argument is of type ‘char *’
#  247 | int             b64_pton (char const *, unsigned char *, size_t) __THROW;
#      |                                         ^~~~~~~~~~~~~~~
# 1379|   	needed = (end / 4) * 3;
# 1380|   	out = xmalloc(needed);
# 1381|-> 	if ((outlen = b64_pton(copy, out, len)) == -1) {
# 1382|   		free(out);
# 1383|   		free(copy);

Error: COMPILER_WARNING (CWE-252): [#def122]
tmux-3.6/tty.c: scope_hint: In function ‘tty_add’
tmux-3.6/tty.c:636:17: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  636 |                 write(tty_log_fd, buf, len);
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  634|   
#  635|   	if (tty_log_fd != -1)
#  636|-> 		write(tty_log_fd, buf, len);
#  637|   	if (tty->flags & TTY_STARTED)
#  638|   		event_add(&tty->event_out, NULL);

Error: COMPILER_WARNING (CWE-681): [#def123]
tmux-3.6/tty.c: scope_hint: In function ‘tty_putc’
tmux-3.6/tty.c:664:38: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘tty_add’ differ in signedness
#  664 |                         tty_add(tty, &ch, 1);
#      |                                      ^~~
#      |                                      |
#      |                                      u_char * {aka unsigned char *}
tmux-3.6/tty.c:622:38: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  622 | tty_add(struct tty *tty, const char *buf, size_t len)
#      |                          ~~~~~~~~~~~~^~~
#  662|   			tty_add(tty, acs, strlen(acs));
#  663|   		else
#  664|-> 			tty_add(tty, &ch, 1);
#  665|   	} else
#  666|   		tty_add(tty, &ch, 1);

Error: COMPILER_WARNING (CWE-681): [#def124]
tmux-3.6/tty.c:666:30: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘tty_add’ differ in signedness
#  666 |                 tty_add(tty, &ch, 1);
#      |                              ^~~
#      |                              |
#      |                              u_char * {aka unsigned char *}
tmux-3.6/tty.c:622:38: note: expected ‘const char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#  622 | tty_add(struct tty *tty, const char *buf, size_t len)
#      |                          ~~~~~~~~~~~~^~~
#  664|   			tty_add(tty, &ch, 1);
#  665|   	} else
#  666|-> 		tty_add(tty, &ch, 1);
#  667|   
#  668|   	if (ch >= 0x20 && ch != 0x7f) {

Error: COMPILER_WARNING (CWE-681): [#def125]
tmux-3.6/tty.c: scope_hint: In function ‘tty_check_codeset’
tmux-3.6/tty.c:1407:46: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘tty_acs_reverse_get’ differ in signedness
# 1407 |         c = tty_acs_reverse_get(tty, gc->data.data, gc->data.size);
#      |                                      ~~~~~~~~^~~~~
#      |                                              |
#      |                                              const u_char * {aka const unsigned char *}
tmux-3.6/tty.c:34: included_from: Included from here.
tmux-3.6/tmux.h:2615:52: note: expected ‘const char *’ but argument is of type ‘const u_char *’ {aka ‘const unsigned char *’}
# 2615 | int              tty_acs_reverse_get(struct tty *, const char *, size_t);
#      |                                                    ^~~~~~~~~~~~
# 1405|   
# 1406|   	/* See if this can be mapped to an ACS character. */
# 1407|-> 	c = tty_acs_reverse_get(tty, gc->data.data, gc->data.size);
# 1408|   	if (c != -1) {
# 1409|   		utf8_set(&new.data, c);

Error: COMPILER_WARNING (CWE-681): [#def126]
tmux-3.6/tty.c: scope_hint: In function ‘tty_set_selection’
tmux-3.6/tty.c:2274:18: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘__b64_ntop’ differ in signedness
# 2274 |         b64_ntop(buf, len, encoded, size);
#      |                  ^~~
#      |                  |
#      |                  const char *
tmux-3.6/tty.c:27: included_from: Included from here.
/usr/include/resolv.h:245:27: note: expected ‘const unsigned char *’ but argument is of type ‘const char *’
#  245 | int             b64_ntop (const unsigned char *, size_t, char *, size_t)
#      |                           ^~~~~~~~~~~~~~~~~~~~~
# 2272|   	encoded = xmalloc(size);
# 2273|   
# 2274|-> 	b64_ntop(buf, len, encoded, size);
# 2275|   	tty->flags |= TTY_NOBLOCK;
# 2276|   	tty_putcode_ss(tty, TTYC_MS, flags, encoded);

Error: COMPILER_WARNING (CWE-681): [#def127]
tmux-3.6/utf8.c: scope_hint: In function ‘utf8_add_to_width_cache’
tmux-3.6/utf8.c:344:38: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘mbtowc’ differ in signedness
#  344 |                 if (mbtowc(&wc, ud[0].data, ud[0].size) <= 0) {
#      |                                 ~~~~~^~~~~
#      |                                      |
#      |                                      u_char * {aka unsigned char *}
tmux-3.6/utf8.c:23: included_from: Included from here.
/usr/include/stdlib.h:1100:43: note: expected ‘const char * restrict’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
# 1100 |                    const char *__restrict __s, size_t __n) __THROW;
#      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~
#  342|   		if (utf8proc_mbtowc(&wc, ud[0].data, ud[0].size) <= 0) {
#  343|   #else
#  344|-> 		if (mbtowc(&wc, ud[0].data, ud[0].size) <= 0) {
#  345|   #endif
#  346|   			free(ud);

Error: COMPILER_WARNING (CWE-681): [#def128]
tmux-3.6/utf8.c: scope_hint: In function ‘utf8_towc’
tmux-3.6/utf8.c:558:30: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘mbtowc’ differ in signedness
#  558 |         switch (mbtowc(wc, ud->data, ud->size)) {
#      |                            ~~^~~~~~
#      |                              |
#      |                              const u_char * {aka const unsigned char *}
/usr/include/stdlib.h:1100:43: note: expected ‘const char * restrict’ but argument is of type ‘const u_char *’ {aka ‘const unsigned char *’}
# 1100 |                    const char *__restrict __s, size_t __n) __THROW;
#      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~
#  556|   	switch (utf8proc_mbtowc(wc, ud->data, ud->size)) {
#  557|   #else
#  558|-> 	switch (mbtowc(wc, ud->data, ud->size)) {
#  559|   #endif
#  560|   	case -1:

Error: COMPILER_WARNING (CWE-681): [#def129]
tmux-3.6/utf8.c: scope_hint: In function ‘utf8_fromwc’
tmux-3.6/utf8.c:581:25: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘wctomb’ differ in signedness
#  581 |         size = wctomb(ud->data, wc);
#      |                       ~~^~~~~~
#      |                         |
#      |                         u_char * {aka unsigned char *}
/usr/include/features.h:540: included_from: Included from here.
/usr/include/sys/types.h:25: included_from: Included from here.
tmux-3.6/utf8.c:19: included_from: Included from here.
/usr/include/bits/stdlib.h:91:16: note: expected ‘char *’ but argument is of type ‘u_char *’ {aka ‘unsigned char *’}
#   91 | __NTH (wctomb (__fortify_clang_overload_arg (char *, ,__s), wchar_t __wchar))
#      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  579|   	size = utf8proc_wctomb(ud->data, wc);
#  580|   #else
#  581|-> 	size = wctomb(ud->data, wc);
#  582|   #endif
#  583|   	if (size < 0) {

Error: COMPILER_WARNING (CWE-252): [#def130]
tmux-3.6/utf8.c:585:17: warning[-Wunused-result]: ignoring return value of ‘wctomb’ declared with attribute ‘warn_unused_result’
#  585 |                 wctomb(NULL, 0);
#      |                 ^~~~~~~~~~~~~~~
#  583|   	if (size < 0) {
#  584|   		log_debug("UTF-8 %d, wctomb() %d", wc, errno);
#  585|-> 		wctomb(NULL, 0);
#  586|   		return (UTF8_ERROR);
#  587|   	}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def131]
tmux-3.6/window-client.c:189:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
tmux-3.6/window-client.c:172:21: branch_false: following ‘false’ branch...
tmux-3.6/window-client.c:174:14: branch_false: ...to here
tmux-3.6/window-client.c:189:15: release_memory: using NULL here
tmux-3.6/window-client.c:189:9: danger: argument 1 (‘*(struct window_client_modedata *)modedata.item_list’) NULL where non-null expected
#  187|   
#  188|   	window_client_sort = sort_crit;
#  189|-> 	qsort(data->item_list, data->item_size, sizeof *data->item_list,
#  190|   	    window_client_cmp);
#  191|   

Error: COMPILER_WARNING (CWE-252): [#def132]
tmux-3.6/window-copy.c: scope_hint: In function ‘window_copy_vadd’
tmux-3.6/window-copy.c:567:17: warning[-Wunused-result]: ignoring return value of ‘vasprintf’ declared with attribute ‘warn_unused_result’
#  567 |                 vasprintf(&text, fmt, ap);
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
#  565|   	old_cy = backing->cy;
#  566|   	if (parse) {
#  567|-> 		vasprintf(&text, fmt, ap);
#  568|   		input_parse_screen(data->ictx, backing, window_copy_init_ctx_cb,
#  569|   		    data, text, strlen(text));

Error: COMPILER_WARNING (CWE-681): [#def133]
tmux-3.6/window-copy.c: scope_hint: In function ‘window_copy_vadd’
tmux-3.6/window-copy.c:569:27: warning[-Wpointer-sign]: pointer targets in passing argument 5 of ‘input_parse_screen’ differ in signedness
#  569 |                     data, text, strlen(text));
#      |                           ^~~~
#      |                           |
#      |                           char *
tmux-3.6/window-copy.c:27: included_from: Included from here.
tmux-3.6/tmux.h:2986:48: note: expected ‘u_char *’ {aka ‘unsigned char *’} but argument is of type ‘char *’
# 2986 |              screen_write_init_ctx_cb, void *, u_char *, size_t);
#      |                                                ^~~~~~~~
#  567|   		vasprintf(&text, fmt, ap);
#  568|   		input_parse_screen(data->ictx, backing, window_copy_init_ctx_cb,
#  569|-> 		    data, text, strlen(text));
#  570|   		free(text);
#  571|   	} else {

Error: COMPILER_WARNING (CWE-681): [#def134]
tmux-3.6/window-copy.c: scope_hint: In function ‘window_copy_cellstring’
tmux-3.6/window-copy.c:3491:25: warning[-Wpointer-sign]: pointer targets in returning ‘u_char *’ {aka ‘unsigned char *’} from a function with return type ‘const char *’ differ in signedness
# 3491 |                 return (&gce->data.data);
#      |                        ~^~~~~~~~~~~~~~~~
# 3489|   		*size = 1;
# 3490|   		*allocated = 0;
# 3491|-> 		return (&gce->data.data);
# 3492|   	}
# 3493|   	if (gce->flags & GRID_FLAG_TAB) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def135]
tmux-3.6/window-copy.c:3591:25: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
tmux-3.6/window-copy.c:5679:1: enter_function: entry to ‘window_copy_scroll_up’
tmux-3.6/window-copy.c:5688:12: branch_false: following ‘false’ branch...
tmux-3.6/window-copy.c:5690:18: branch_false: ...to here
tmux-3.6/window-copy.c:5692:12: branch_true: following ‘true’ branch...
tmux-3.6/window-copy.c:5693:17: call_function: calling ‘window_copy_search_marks’ from ‘window_copy_scroll_up’
# 3589|   			buf[bx++] = *d;
# 3590|   		else {
# 3591|-> 			memcpy(buf + bx, d, dlen);
# 3592|   			bx += dlen;
# 3593|   		}

Error: COMPILER_WARNING (CWE-681): [#def136]
tmux-3.6/window-copy.c: scope_hint: In function ‘window_copy_append_selection’
tmux-3.6/window-copy.c:5006:53: warning[-Wpointer-sign]: pointer targets in passing argument 3 of ‘screen_write_setselection’ differ in signedness
# 5006 |                 screen_write_setselection(&ctx, "", buf, len);
#      |                                                     ^~~
#      |                                                     |
#      |                                                     char *
tmux-3.6/tmux.h:3168:14: note: expected ‘u_char *’ {aka ‘unsigned char *’} but argument is of type ‘char *’
# 3168 |              u_char *, u_int);
#      |              ^~~~~~~~
# 5004|   	if (options_get_number(global_options, "set-clipboard") != 0) {
# 5005|   		screen_write_start_pane(&ctx, wp, NULL);
# 5006|-> 		screen_write_setselection(&ctx, "", buf, len);
# 5007|   		screen_write_stop(&ctx);
# 5008|   		notify_pane("pane-set-clipboard", wp);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def137]
tmux-3.6/window-tree.c:239:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘wla’
tmux-3.6/window-tree.c:927:1: enter_function: entry to ‘window_tree_swap’
tmux-3.6/window-tree.c:941:9: call_function: calling ‘window_tree_pull_item’ from ‘window_tree_swap’
tmux-3.6/window-tree.c:941:9: return_function: returning to ‘window_tree_swap’ from ‘window_tree_pull_item’
tmux-3.6/window-tree.c:942:9: call_function: calling ‘window_tree_pull_item’ from ‘window_tree_swap’
tmux-3.6/window-tree.c:942:9: return_function: returning to ‘window_tree_swap’ from ‘window_tree_pull_item’
tmux-3.6/window-tree.c:945:12: branch_false: following ‘false’ branch...
tmux-3.6/window-tree.c:948:29: branch_false: ...to here
tmux-3.6/window-tree.c:948:12: branch_true: following ‘true’ branch...
tmux-3.6/window-tree.c:949:13: branch_true: ...to here
tmux-3.6/window-tree.c:949:13: call_function: calling ‘window_tree_cmp_window’ from ‘window_tree_swap’
#  237|   	const struct winlink		*wla = *a;
#  238|   	const struct winlink		*wlb = *b;
#  239|-> 	struct window			*wa = wla->window;
#  240|   	struct window			*wb = wlb->window;
#  241|   	int				 result = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def138]
tmux-3.6/window-tree.c:450: warning[nullPointer]: Possible null pointer dereference: l
#  448|   	}
#  449|   	window_tree_sort = sort_crit;
#  450|-> 	qsort(l, n, sizeof *l, window_tree_cmp_window);
#  451|   
#  452|   	empty = 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def139]
tmux-3.6/window-tree.c:450:9: warning[-Wanalyzer-null-argument]: use of NULL ‘l’ where non-null expected
tmux-3.6/window-tree.c:445:9: branch_false: following ‘false’ branch (when ‘wl’ is NULL)...
tmux-3.6/window-tree.c:449:9: branch_false: ...to here
tmux-3.6/window-tree.c:450:9: danger: argument 1 (‘l’) NULL where non-null expected
#  448|   	}
#  449|   	window_tree_sort = sort_crit;
#  450|-> 	qsort(l, n, sizeof *l, window_tree_cmp_window);
#  451|   
#  452|   	empty = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def140]
tmux-3.6/window-tree.c:496: warning[nullPointer]: Possible null pointer dereference: l
#  494|   	}
#  495|   	window_tree_sort = sort_crit;
#  496|-> 	qsort(l, n, sizeof *l, window_tree_cmp_session);
#  497|   
#  498|   	for (i = 0; i < n; i++)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def141]
tmux-3.6/window-tree.c:496:9: warning[-Wanalyzer-null-argument]: use of NULL ‘l’ where non-null expected
tmux-3.6/window-tree.c:477:21: branch_false: following ‘false’ branch...
tmux-3.6/window-tree.c:479:14: branch_false: ...to here
tmux-3.6/window-tree.c:496:9: danger: argument 1 (‘l’) NULL where non-null expected
#  494|   	}
#  495|   	window_tree_sort = sort_crit;
#  496|-> 	qsort(l, n, sizeof *l, window_tree_cmp_session);
#  497|   
#  498|   	for (i = 0; i < n; i++)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def142]
tmux-3.6/window-tree.c:957:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cur_winlink’
tmux-3.6/window-tree.c:927:1: enter_function: entry to ‘window_tree_swap’
tmux-3.6/window-tree.c:941:9: call_function: calling ‘window_tree_pull_item’ from ‘window_tree_swap’
tmux-3.6/window-tree.c:941:9: return_function: returning to ‘window_tree_swap’ from ‘window_tree_pull_item’
tmux-3.6/window-tree.c:942:9: call_function: calling ‘window_tree_pull_item’ from ‘window_tree_swap’
tmux-3.6/window-tree.c:942:9: return_function: returning to ‘window_tree_swap’ from ‘window_tree_pull_item’
tmux-3.6/window-tree.c:945:12: branch_false: following ‘false’ branch...
tmux-3.6/window-tree.c:948:29: branch_false: ...to here
tmux-3.6/window-tree.c:948:12: branch_false: following ‘false’ branch...
tmux-3.6/window-tree.c:957:37: branch_false: ...to here
tmux-3.6/window-tree.c:957:37: release_memory: ‘cur_winlink’ is NULL
tmux-3.6/window-tree.c:957:9: danger: dereference of NULL ‘other_winlink’
#  955|   	}
#  956|   
#  957|-> 	other_window = other_winlink->window;
#  958|   	TAILQ_REMOVE(&other_window->winlinks, other_winlink, wentry);
#  959|   	cur_window = cur_winlink->window;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def143]
tmux-3.6/xmalloc.c:153:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
tmux-3.6/xmalloc.c:135:1: enter_function: entry to ‘xsnprintf’
tmux-3.6/xmalloc.c:140:9: acquire_resource: ‘va_start’ called here
tmux-3.6/xmalloc.c:141:13: call_function: calling ‘xvsnprintf’ from ‘xsnprintf’
#  151|   
#  152|   	if (len > INT_MAX)
#  153|-> 		fatalx("xsnprintf: len > INT_MAX");
#  154|   
#  155|   	i = vsnprintf(str, len, fmt, ap);

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-109.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nametmux-3.6-1.fc44
store-results-to/tmp/tmpvkajpcdh/tmux-3.6-1.fc44.tar.xz
time-created2026-01-08 21:55:00
time-finished2026-01-08 21:57:10
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpvkajpcdh/tmux-3.6-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpvkajpcdh/tmux-3.6-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9