mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	Apply length limits and substitution even to literal formats.
This commit is contained in:
		
							
								
								
									
										2
									
								
								format.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								format.c
									
									
									
									
									
								
							@@ -1293,6 +1293,7 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen,
 | 
				
			|||||||
			value = xstrdup("");
 | 
								value = xstrdup("");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					done:
 | 
				
			||||||
	/* Expand again if required. */
 | 
						/* Expand again if required. */
 | 
				
			||||||
	if (modifiers & FORMAT_EXPAND) {
 | 
						if (modifiers & FORMAT_EXPAND) {
 | 
				
			||||||
		new = format_expand(ft, value);
 | 
							new = format_expand(ft, value);
 | 
				
			||||||
@@ -1318,7 +1319,6 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen,
 | 
				
			|||||||
		value = new;
 | 
							value = new;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
done:
 | 
					 | 
				
			||||||
	/* Expand the buffer and copy in the value. */
 | 
						/* Expand the buffer and copy in the value. */
 | 
				
			||||||
	valuelen = strlen(value);
 | 
						valuelen = strlen(value);
 | 
				
			||||||
	while (*len - *off < valuelen + 1) {
 | 
						while (*len - *off < valuelen + 1) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user