mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	sway: fix potential buffer overflow
This commit is contained in:
		
							parent
							
								
									aece36cd22
								
							
						
					
					
						commit
						e53ba08626
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -506,7 +506,8 @@ static struct cmd_results *cmd_exec_always(int argc, char **argv) {
 | 
			
		|||
 | 
			
		||||
	// Put argument into cmd array
 | 
			
		||||
	char cmd[4096];
 | 
			
		||||
	strcpy(cmd, tmp);
 | 
			
		||||
	strncpy(cmd, tmp, sizeof(cmd));
 | 
			
		||||
	cmd[sizeof(cmd) - 1] = 0;
 | 
			
		||||
	free(tmp);
 | 
			
		||||
	sway_log(L_DEBUG, "Executing %s", cmd);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue