Clarify the last argument of GetDescDocumentAndURL has size LINE_SIZE.
This commit is contained in:
parent
bd7f83feb5
commit
19a23dafba
@ -8,6 +8,7 @@ Version 1.6.16
|
||||
|
||||
Treat large argument as error in UpnpAddVirtualDir.
|
||||
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.
|
||||
|
||||
2012-03-10 Yoichi NAKAYAMA <yoichi.nakayama(at)gmail.com>
|
||||
|
@ -901,7 +901,7 @@ static int GetDescDocumentAndURL(
|
||||
/* [out] . */
|
||||
IXML_Document **xmlDoc,
|
||||
/* [out] . */
|
||||
char *descURL);
|
||||
char descURL[LINE_SIZE]);
|
||||
|
||||
|
||||
#ifdef INCLUDE_DEVICE_APIS
|
||||
@ -1461,7 +1461,7 @@ static int GetDescDocumentAndURL(
|
||||
int config_baseURL,
|
||||
int AddressFamily,
|
||||
IXML_Document **xmlDoc,
|
||||
char *descURL)
|
||||
char descURL[LINE_SIZE])
|
||||
{
|
||||
int retVal = 0;
|
||||
char *membuf = NULL;
|
||||
@ -1559,12 +1559,12 @@ static int GetDescDocumentAndURL(
|
||||
}
|
||||
} else {
|
||||
/* Manual */
|
||||
if (strlen(description) > (LINE_SIZE - 1)) {
|
||||
if (strlen(description) > LINE_SIZE - 1) {
|
||||
ixmlDocument_free(*xmlDoc);
|
||||
return UPNP_E_URL_TOO_BIG;
|
||||
}
|
||||
strncpy(descURL, description, strlen(description));
|
||||
descURL[strlen(description)] = '\0';
|
||||
strncpy(descURL, description, LINE_SIZE - 1);
|
||||
descURL[LINE_SIZE - 1] = '\0';
|
||||
}
|
||||
|
||||
assert(*xmlDoc != NULL);
|
||||
@ -1580,7 +1580,7 @@ static int GetDescDocumentAndURL(
|
||||
int config_baseURL,
|
||||
int AddressFamily,
|
||||
IXML_Document **xmlDoc,
|
||||
char *descURL)
|
||||
char descURL[LINE_SIZE])
|
||||
{
|
||||
int retVal = 0;
|
||||
|
||||
@ -1592,11 +1592,11 @@ static int GetDescDocumentAndURL(
|
||||
return UPNP_E_INVALID_PARAM;
|
||||
}
|
||||
|
||||
if (strlen(description) > (LINE_SIZE - 1)) {
|
||||
if (strlen(description) > LINE_SIZE - 1) {
|
||||
return UPNP_E_URL_TOO_BIG;
|
||||
}
|
||||
strncpy(descURL, description, strlen(description));
|
||||
descURL[strlen(description)] = '\0';
|
||||
strncpy(descURL, description, LINE_SIZE - 1);
|
||||
descURL[LINE_SIZE - 1] = '\0';
|
||||
|
||||
retVal = UpnpDownloadXmlDoc(description, xmlDoc);
|
||||
if (retVal != UPNP_E_SUCCESS) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user