Use strncpy with the standard way in readFromSSDPSocket.
(cherry picked from commit 04e5767ea0)
			
			
This commit is contained in:
		
				
					committed by
					
						
						Marcelo Roberto Jimenez
					
				
			
			
				
	
			
			
			
						parent
						
							c9024bbb40
						
					
				
				
					commit
					8871805c77
				
			@@ -331,6 +331,7 @@ Version 1.6.16
 | 
			
		||||
	* Respect unique_service_name error in ssdp_request_type
 | 
			
		||||
	  so as not to touch non-terminated buffer under Evt.
 | 
			
		||||
	* Treat large argument as error in UpnpAddVirtualDir.
 | 
			
		||||
	* Use strncpy with the standard way in readFromSSDPSocket.
 | 
			
		||||
	* Do not clear buffer before snprintf.
 | 
			
		||||
	* Clarify the last argument of GetDescDocumentAndURL has size LINE_SIZE.
 | 
			
		||||
	* For inet_ntop, use buffer with size INET6_ADDRSTRLEN or INET_ADDRSTRLEN.
 | 
			
		||||
 
 | 
			
		||||
@@ -753,9 +753,11 @@ void readFromSSDPSocket(SOCKET socket)
 | 
			
		||||
				  &((struct sockaddr_in6 *)&__ss)->sin6_addr,
 | 
			
		||||
				  ntop_buf, sizeof(ntop_buf));
 | 
			
		||||
#endif /* UPNP_ENABLE_IPV6 */
 | 
			
		||||
		else
 | 
			
		||||
		else {
 | 
			
		||||
			memset(ntop_buf, 0, sizeof(ntop_buf));
 | 
			
		||||
			strncpy(ntop_buf, "<Invalid address family>",
 | 
			
		||||
				sizeof(ntop_buf));
 | 
			
		||||
				sizeof(ntop_buf) - 1);
 | 
			
		||||
		}
 | 
			
		||||
		UpnpPrintf(UPNP_INFO, SSDP, __FILE__, __LINE__,
 | 
			
		||||
			   "Start of received response ----------------------------------------------------\n"
 | 
			
		||||
			   "%s\n"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user