CID:1214130 Buffer not null terminated

This commit is contained in:
Michael Jerris 2014-05-16 14:37:43 +00:00
parent ebc0a99f1c
commit 455ed10e40
2 changed files with 2 additions and 2 deletions

View File

@ -158,7 +158,7 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
char *uri = NULL;
char *dynamic_url = NULL;
strncpy(hostname, switch_core_get_switchname(), sizeof(hostname));
strncpy(hostname, switch_core_get_switchname(), sizeof(hostname) - 1);
if (!binding) {
return NULL;

View File

@ -145,7 +145,7 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
switch_stream_handle_t stream = { 0 };
char *txt = NULL;
strncpy(hostname, switch_core_get_switchname(), sizeof(hostname));
strncpy(hostname, switch_core_get_switchname(), sizeof(hostname) - 1);
if (!binding) {
return NULL;