Use strncpy with the standard way in readFromSSDPSocket.
This commit is contained in:
parent
5944960e17
commit
04e5767ea0
@ -15,6 +15,7 @@ Version 1.6.16
|
|||||||
* Respect unique_service_name error in ssdp_request_type
|
* Respect unique_service_name error in ssdp_request_type
|
||||||
so as not to touch non-terminated buffer under Evt.
|
so as not to touch non-terminated buffer under Evt.
|
||||||
* Treat large argument as error in UpnpAddVirtualDir.
|
* Treat large argument as error in UpnpAddVirtualDir.
|
||||||
|
* Use strncpy with the standard way in readFromSSDPSocket.
|
||||||
* Do not clear buffer before snprintf.
|
* Do not clear buffer before snprintf.
|
||||||
* Clarify the last argument of GetDescDocumentAndURL has size LINE_SIZE.
|
* Clarify the last argument of GetDescDocumentAndURL has size LINE_SIZE.
|
||||||
* For inet_ntop, use buffer with size INET6_ADDRSTRLEN or INET_ADDRSTRLEN.
|
* 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,
|
&((struct sockaddr_in6 *)&__ss)->sin6_addr,
|
||||||
ntop_buf, sizeof(ntop_buf));
|
ntop_buf, sizeof(ntop_buf));
|
||||||
#endif /* UPNP_ENABLE_IPV6 */
|
#endif /* UPNP_ENABLE_IPV6 */
|
||||||
else
|
else {
|
||||||
|
memset(ntop_buf, 0, sizeof(ntop_buf));
|
||||||
strncpy(ntop_buf, "<Invalid address family>",
|
strncpy(ntop_buf, "<Invalid address family>",
|
||||||
sizeof(ntop_buf));
|
sizeof(ntop_buf) - 1);
|
||||||
|
}
|
||||||
UpnpPrintf(UPNP_INFO, SSDP, __FILE__, __LINE__,
|
UpnpPrintf(UPNP_INFO, SSDP, __FILE__, __LINE__,
|
||||||
"Start of received response ----------------------------------------------------\n"
|
"Start of received response ----------------------------------------------------\n"
|
||||||
"%s\n"
|
"%s\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user