mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	protocol: don't allow NULL event or command
If causes crashes when the handlers try to get the ID.
This commit is contained in:
		
							parent
							
								
									4fd1f88a99
								
							
						
					
					
						commit
						591330ab74
					
				
					 2 changed files with 12 additions and 0 deletions
				
			
		| 
						 | 
					@ -412,6 +412,9 @@ static int client_node_demarshal_event_event(void *data, const struct pw_protoco
 | 
				
			||||||
				SPA_POD_PodObject(&event)) < 0)
 | 
									SPA_POD_PodObject(&event)) < 0)
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (event == NULL)
 | 
				
			||||||
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_proxy_notify(proxy, struct pw_client_node_events, event, 0, event);
 | 
						pw_proxy_notify(proxy, struct pw_client_node_events, event, 0, event);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -427,6 +430,9 @@ static int client_node_demarshal_command(void *data, const struct pw_protocol_na
 | 
				
			||||||
			SPA_POD_PodObject(&command)) < 0)
 | 
								SPA_POD_PodObject(&command)) < 0)
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (command == NULL)
 | 
				
			||||||
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_proxy_notify(proxy, struct pw_client_node_events, command, 0, command);
 | 
						pw_proxy_notify(proxy, struct pw_client_node_events, command, 0, command);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1097,6 +1103,9 @@ static int client_node_demarshal_event_method(void *object, const struct pw_prot
 | 
				
			||||||
			SPA_POD_PodObject(&event)) < 0)
 | 
								SPA_POD_PodObject(&event)) < 0)
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (event == NULL)
 | 
				
			||||||
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_resource_notify(resource, struct pw_client_node_methods, event, 0, event);
 | 
						pw_resource_notify(resource, struct pw_client_node_methods, event, 0, event);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1342,6 +1342,9 @@ static int node_demarshal_send_command(void *object, const struct pw_protocol_na
 | 
				
			||||||
				SPA_POD_Pod(&command)) < 0)
 | 
									SPA_POD_Pod(&command)) < 0)
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (command == NULL)
 | 
				
			||||||
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return pw_resource_notify(resource, struct pw_node_methods, send_command, 0, command);
 | 
						return pw_resource_notify(resource, struct pw_node_methods, send_command, 0, command);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue