mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Don't write into buffer if no arguments, reported by Filipe Rosset.
This commit is contained in:
		
							
								
								
									
										3
									
								
								cmd.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								cmd.c
									
									
									
									
									
								
							@@ -139,6 +139,9 @@ cmd_pack_argv(int argc, char **argv, char *buf, size_t len)
 | 
				
			|||||||
	size_t	arglen;
 | 
						size_t	arglen;
 | 
				
			||||||
	int	i;
 | 
						int	i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (argc == 0)
 | 
				
			||||||
 | 
							return (0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	*buf = '\0';
 | 
						*buf = '\0';
 | 
				
			||||||
	for (i = 0; i < argc; i++) {
 | 
						for (i = 0; i < argc; i++) {
 | 
				
			||||||
		if (strlcpy(buf, argv[i], len) >= len)
 | 
							if (strlcpy(buf, argv[i], len) >= len)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user