mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:07:38 +00:00 
			
		
		
		
	Do not use the command if the kernel didn't return the full size.
This commit is contained in:
		@@ -61,7 +61,7 @@ osdep_get_name(int fd, __unused char *tty)
 | 
			
		||||
	size = sizeof kp;
 | 
			
		||||
	if (sysctl(mib, 4, &kp, &size, NULL, 0) == -1)
 | 
			
		||||
		return (NULL);
 | 
			
		||||
	if (*kp.kp_proc.p_comm == '\0')
 | 
			
		||||
	if (size != (sizeof kp) || *kp.kp_proc.p_comm == '\0')
 | 
			
		||||
		return (NULL);
 | 
			
		||||
 | 
			
		||||
	return (strdup(kp.kp_proc.p_comm));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user