mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Do not dereference pane when it is NULL, fixes a crash when creating a
hook from the config, GitHub issue 2820.
This commit is contained in:
		
							
								
								
									
										2
									
								
								format.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								format.c
									
									
									
									
									
								
							@@ -3098,7 +3098,7 @@ format_log_debug_cb(const char *key, const char *value, void *arg)
 | 
				
			|||||||
void
 | 
					void
 | 
				
			||||||
format_log_debug(struct format_tree *ft, const char *prefix)
 | 
					format_log_debug(struct format_tree *ft, const char *prefix)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	format_each(ft, format_log_debug_cb, prefix);
 | 
						format_each(ft, format_log_debug_cb, (void *)prefix);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Walk each format. */
 | 
					/* Walk each format. */
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								notify.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								notify.c
									
									
									
									
									
								
							@@ -200,7 +200,7 @@ notify_hook(struct cmdq_item *item, const char *name)
 | 
				
			|||||||
	ne.client = cmdq_get_client(item);
 | 
						ne.client = cmdq_get_client(item);
 | 
				
			||||||
	ne.session = target->s;
 | 
						ne.session = target->s;
 | 
				
			||||||
	ne.window = target->w;
 | 
						ne.window = target->w;
 | 
				
			||||||
	ne.pane = target->wp->id;
 | 
						ne.pane = (target->wp != NULL ? target->wp->id : -1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ne.formats = format_create(NULL, NULL, 0, FORMAT_NOJOBS);
 | 
						ne.formats = format_create(NULL, NULL, 0, FORMAT_NOJOBS);
 | 
				
			||||||
	format_add(ne.formats, "hook", "%s", name);
 | 
						format_add(ne.formats, "hook", "%s", name);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user