Replace strcpy with strncpy in get_hoststr
Replace strcpy with strncpy to avoid buffer overflow.
This commit is contained in:
parent
eb16f52b1a
commit
666bc7392b
@ -2,6 +2,12 @@
|
||||
Version 1.8.0
|
||||
*******************************************************************************
|
||||
|
||||
2012-03-08 Fabrice Fontaine <fabrice.fontaine(at)orange-ftgroup.com>
|
||||
|
||||
Replace strcpy with strncpy in get_hoststr
|
||||
|
||||
Replace strcpy with strncpy to avoid buffer overflow.
|
||||
|
||||
2012-03-08 Fabrice Fontaine <fabrice.fontaine(at)orange-ftgroup.com>
|
||||
|
||||
Memory leak fix in handle_query_variable
|
||||
|
@ -169,7 +169,8 @@ static int get_hoststr(const char* url_str,
|
||||
{
|
||||
char *urlPath = alloca(strlen(url_str) + 1);
|
||||
char *temp;
|
||||
strcpy(urlPath, url_str);
|
||||
memset(urlPath, 0, strlen(url_str) + 1);
|
||||
strncpy(urlPath, url_str, strlen(url_str));
|
||||
*hoststr = strstr(urlPath, "//");
|
||||
if (*hoststr == NULL)
|
||||
return UPNP_E_INVALID_URL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user