mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Do not try to put more in command message than will fit when sending
(the server will treat as a fatal error). GitHub issue 1200.
This commit is contained in:
		
							
								
								
									
										4
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								client.c
									
									
									
									
									
								
							@@ -337,6 +337,10 @@ client_main(struct event_base *base, int argc, char **argv, int flags)
 | 
				
			|||||||
		size = 0;
 | 
							size = 0;
 | 
				
			||||||
		for (i = 0; i < argc; i++)
 | 
							for (i = 0; i < argc; i++)
 | 
				
			||||||
			size += strlen(argv[i]) + 1;
 | 
								size += strlen(argv[i]) + 1;
 | 
				
			||||||
 | 
							if (size > MAX_IMSGSIZE - (sizeof *data)) {
 | 
				
			||||||
 | 
								fprintf(stderr, "command too long\n");
 | 
				
			||||||
 | 
								return (1);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		data = xmalloc((sizeof *data) + size);
 | 
							data = xmalloc((sizeof *data) + size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* Prepare command for server. */
 | 
							/* Prepare command for server. */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user