mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	Ignore environment variables that are too long to send to the server.
This commit is contained in:
		
							
								
								
									
										8
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								client.c
									
									
									
									
									
								
							@@ -350,6 +350,7 @@ client_send_identify(int flags)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	const char	 *s;
 | 
						const char	 *s;
 | 
				
			||||||
	char		**ss;
 | 
						char		**ss;
 | 
				
			||||||
 | 
						size_t		  sslen;
 | 
				
			||||||
	int		  fd;
 | 
						int		  fd;
 | 
				
			||||||
	pid_t		  pid;
 | 
						pid_t		  pid;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -374,8 +375,11 @@ client_send_identify(int flags)
 | 
				
			|||||||
	pid = getpid();
 | 
						pid = getpid();
 | 
				
			||||||
	client_write_one(MSG_IDENTIFY_CLIENTPID, -1, &pid, sizeof pid);
 | 
						client_write_one(MSG_IDENTIFY_CLIENTPID, -1, &pid, sizeof pid);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (ss = environ; *ss != NULL; ss++)
 | 
						for (ss = environ; *ss != NULL; ss++) {
 | 
				
			||||||
		client_write_one(MSG_IDENTIFY_ENVIRON, -1, *ss, strlen(*ss) + 1);
 | 
							sslen = strlen(*ss) + 1;
 | 
				
			||||||
 | 
							if (sslen <= MAX_IMSGSIZE - IMSG_HEADER_SIZE)
 | 
				
			||||||
 | 
								client_write_one(MSG_IDENTIFY_ENVIRON, -1, *ss, sslen);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	client_write_one(MSG_IDENTIFY_DONE, -1, NULL, 0);
 | 
						client_write_one(MSG_IDENTIFY_DONE, -1, NULL, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user