mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Check fdopen return value, from Christian Menges.
This commit is contained in:
		
							
								
								
									
										2
									
								
								popup.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								popup.c
									
									
									
									
									
								
							@@ -788,6 +788,8 @@ popup_editor(struct client *c, const char *buf, size_t len,
 | 
				
			|||||||
	if (fd == -1)
 | 
						if (fd == -1)
 | 
				
			||||||
		return (-1);
 | 
							return (-1);
 | 
				
			||||||
	f = fdopen(fd, "w");
 | 
						f = fdopen(fd, "w");
 | 
				
			||||||
 | 
						if (f == NULL)
 | 
				
			||||||
 | 
							return (-1);
 | 
				
			||||||
	if (fwrite(buf, len, 1, f) != 1) {
 | 
						if (fwrite(buf, len, 1, f) != 1) {
 | 
				
			||||||
		fclose(f);
 | 
							fclose(f);
 | 
				
			||||||
		return (-1);
 | 
							return (-1);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user