mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	dbus: protect against NULL data
Make sure we don't accidentally unref a NULL data.
This commit is contained in:
		
							parent
							
								
									bf112940d0
								
							
						
					
					
						commit
						c6dc7e98fd
					
				
					 1 changed files with 15 additions and 6 deletions
				
			
		| 
						 | 
					@ -188,7 +188,9 @@ static void toggle_watch(DBusWatch *watch, void *userdata)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_log_debug(impl->log, "toggle watch %p", watch);
 | 
						spa_log_debug(impl->log, "toggle watch %p", watch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((data = dbus_watch_get_data(watch)) != NULL)
 | 
						if ((data = dbus_watch_get_data(watch)) == NULL)
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_loop_utils_update_io(impl->utils, data->source, dbus_to_io(watch));
 | 
						spa_loop_utils_update_io(impl->utils, data->source, dbus_to_io(watch));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -198,9 +200,15 @@ handle_timer_event(void *userdata, uint64_t expirations)
 | 
				
			||||||
	DBusTimeout *timeout = userdata;
 | 
						DBusTimeout *timeout = userdata;
 | 
				
			||||||
	uint64_t t;
 | 
						uint64_t t;
 | 
				
			||||||
	struct timespec ts;
 | 
						struct timespec ts;
 | 
				
			||||||
	struct source_data *data = dbus_timeout_get_data(timeout);
 | 
						struct source_data *data;
 | 
				
			||||||
	struct connection *conn = data->conn;
 | 
						struct connection *conn;
 | 
				
			||||||
	struct impl *impl = conn->impl;
 | 
						struct impl *impl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if ((data = dbus_timeout_get_data(timeout)) == NULL)
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						conn = data->conn;
 | 
				
			||||||
 | 
						impl = conn->impl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_log_debug(impl->log, "timeout %p conn:%p impl:%p", timeout, conn, impl);
 | 
						spa_log_debug(impl->log, "timeout %p conn:%p impl:%p", timeout, conn, impl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -257,7 +265,8 @@ static void toggle_timeout(DBusTimeout *timeout, void *userdata)
 | 
				
			||||||
	struct source_data *data;
 | 
						struct source_data *data;
 | 
				
			||||||
	struct timespec ts, *tsp;
 | 
						struct timespec ts, *tsp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	data = dbus_timeout_get_data(timeout);
 | 
						if ((data = dbus_timeout_get_data(timeout)) == NULL)
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_log_debug(impl->log, "toggle timeout %p conn:%p impl:%p", timeout, conn, impl);
 | 
						spa_log_debug(impl->log, "toggle timeout %p conn:%p impl:%p", timeout, conn, impl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue