mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	Terminate PW_KEY_SEC_LABEL key with '\0'
The socket call does not terminate the string with '\0' so we have to use the length explicitly. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
This commit is contained in:
		
							parent
							
								
									634a9558e4
								
							
						
					
					
						commit
						e58d33e8d8
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -369,7 +369,9 @@ static struct client_data *client_new(struct server *s, int fd)
 | 
				
			||||||
	if (getsockopt(fd, SOL_SOCKET, SO_PEERSEC, buffer, &len) < 0) {
 | 
						if (getsockopt(fd, SOL_SOCKET, SO_PEERSEC, buffer, &len) < 0) {
 | 
				
			||||||
		pw_log_warn("server %p: no peersec: %m", s);
 | 
							pw_log_warn("server %p: no peersec: %m", s);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		pw_properties_setf(props, PW_KEY_SEC_LABEL, "%s", buffer);
 | 
							/* buffer is not null terminated, must use length explicitly */
 | 
				
			||||||
 | 
							pw_properties_setf(props, PW_KEY_SEC_LABEL, "%.*s",
 | 
				
			||||||
 | 
									(int)len, buffer);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue