mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: terminate connection in more cases
If any of those two branches are taken, the connection cannot make forward progress since no data will be read/sent from/to the client. For example, sending just 21 invalid bytes to the server causes the first 20 bytes (client descriptor) to be read, then rejected, leaving `client->message == NULL`. But since polling is level triggered, `on_client_data()` and thus `do_read()` will continue to be called ceaselessly, thereby spamming the log and wasting resources.
This commit is contained in:
		
							parent
							
								
									bc6adbe15d
								
							
						
					
					
						commit
						1cb613ee4b
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -5523,7 +5523,7 @@ static int do_read(struct client *client)
 | 
			
		|||
		uint32_t idx = client->in_index - sizeof(client->desc);
 | 
			
		||||
 | 
			
		||||
		if (client->message == NULL) {
 | 
			
		||||
			res = -EIO;
 | 
			
		||||
			res = -EPROTO;
 | 
			
		||||
			goto exit;
 | 
			
		||||
		}
 | 
			
		||||
		data = SPA_PTROFF(client->message->data, idx, void);
 | 
			
		||||
| 
						 | 
				
			
			@ -5551,7 +5551,7 @@ static int do_read(struct client *client)
 | 
			
		|||
 | 
			
		||||
		flags = ntohl(client->desc.flags);
 | 
			
		||||
		if ((flags & FLAG_SHMMASK) != 0) {
 | 
			
		||||
			res = -ENOTSUP;
 | 
			
		||||
			res = -EPROTO;
 | 
			
		||||
			goto exit;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue