For inet_ntop, use buffer with size INET6_ADDRSTRLEN or INET_ADDRSTRLEN.
This commit is contained in:
parent
e4678168fa
commit
bd7f83feb5
@ -8,6 +8,7 @@ Version 1.6.16
|
||||
|
||||
Treat large argument as error in UpnpAddVirtualDir.
|
||||
Do not clear buffer before snprintf.
|
||||
For inet_ntop, use buffer with size INET6_ADDRSTRLEN or INET_ADDRSTRLEN.
|
||||
|
||||
2012-03-10 Yoichi NAKAYAMA <yoichi.nakayama(at)gmail.com>
|
||||
|
||||
|
@ -3308,7 +3308,7 @@ int UpnpGetIfInfo(const char *IfName)
|
||||
struct in6_addr v6_addr;
|
||||
unsigned if_idx;
|
||||
char addr6[8][5];
|
||||
char buf[65]; /* INET6_ADDRSTRLEN */
|
||||
char buf[INET6_ADDRSTRLEN];
|
||||
int ifname_found = 0;
|
||||
int valid_addr_found = 0;
|
||||
|
||||
@ -3675,7 +3675,7 @@ int PrintHandleInfo(UpnpClient_Handle Hnd)
|
||||
int getlocalhostname(char *out, size_t out_len)
|
||||
{
|
||||
int ret = UPNP_E_SUCCESS;
|
||||
char tempstr[16];
|
||||
char tempstr[INET_ADDRSTRLEN];
|
||||
const char *p = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
|
@ -334,7 +334,7 @@ static int receive_from_stopSock(SOCKET ssock, fd_set *set)
|
||||
socklen_t clientLen;
|
||||
struct sockaddr_storage clientAddr;
|
||||
char requestBuf[256];
|
||||
char buf_ntop[64];
|
||||
char buf_ntop[INET6_ADDRSTRLEN];
|
||||
|
||||
if (FD_ISSET(ssock, set)) {
|
||||
clientLen = sizeof(clientAddr);
|
||||
|
@ -184,7 +184,7 @@ static int NewRequestHandler(
|
||||
/* a/c to UPNP Spec */
|
||||
int ttl = 4;
|
||||
int hops = 1;
|
||||
char buf_ntop[64];
|
||||
char buf_ntop[INET6_ADDRSTRLEN];
|
||||
int ret = UPNP_E_SUCCESS;
|
||||
|
||||
ReplySock = socket(DestAddr->sa_family, SOCK_DGRAM, 0);
|
||||
|
@ -705,7 +705,7 @@ void readFromSSDPSocket(SOCKET socket)
|
||||
ssdp_thread_data *data = NULL;
|
||||
socklen_t socklen = sizeof(__ss);
|
||||
ssize_t byteReceived = 0;
|
||||
char ntop_buf[64];
|
||||
char ntop_buf[INET6_ADDRSTRLEN];
|
||||
|
||||
memset(&job, 0, sizeof(job));
|
||||
|
||||
|
@ -77,7 +77,7 @@ static UPNP_INLINE void
|
||||
addrToString( IN const struct sockaddr *addr,
|
||||
OUT char ipaddr_port[] )
|
||||
{
|
||||
char buf_ntop[64];
|
||||
char buf_ntop[INET6_ADDRSTRLEN];
|
||||
|
||||
if( addr->sa_family == AF_INET ) {
|
||||
struct sockaddr_in* sa4 = (struct sockaddr_in*)addr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user