mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	tty.path can be NULL, don't dereference it. From George Nachman.
This commit is contained in:
		@@ -79,7 +79,7 @@ cmd_choose_client_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
	cur = idx = 0;
 | 
			
		||||
	for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
 | 
			
		||||
		c1 = ARRAY_ITEM(&clients, i);
 | 
			
		||||
		if (c1 == NULL || c1->session == NULL)
 | 
			
		||||
		if (c1 == NULL || c1->session == NULL || c1->tty.path == NULL)
 | 
			
		||||
			continue;
 | 
			
		||||
		if (c1 == cmdq->client)
 | 
			
		||||
			cur = idx;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								cmd.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								cmd.c
									
									
									
									
									
								
							@@ -326,9 +326,9 @@ cmd_current_session(struct cmd_q *cmdq, int prefer_unattached)
 | 
			
		||||
		return (c->session);
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * If the name of the calling client's pty is know, build a list of the
 | 
			
		||||
	 * sessions that contain it and if any choose either the first or the
 | 
			
		||||
	 * newest.
 | 
			
		||||
	 * If the name of the calling client's pty is known, build a list of
 | 
			
		||||
	 * the sessions that contain it and if any choose either the first or
 | 
			
		||||
	 * the newest.
 | 
			
		||||
	 */
 | 
			
		||||
	path = c == NULL ? NULL : c->tty.path;
 | 
			
		||||
	if (path != NULL) {
 | 
			
		||||
@@ -531,7 +531,7 @@ cmd_lookup_client(const char *name)
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
 | 
			
		||||
		c = ARRAY_ITEM(&clients, i);
 | 
			
		||||
		if (c == NULL || c->session == NULL)
 | 
			
		||||
		if (c == NULL || c->session == NULL || c->tty.path == NULL)
 | 
			
		||||
			continue;
 | 
			
		||||
		path = c->tty.path;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user