diff --git a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c index 334774d53f..112b370af0 100644 --- a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c +++ b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c @@ -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; diff --git a/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.c b/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.c index 981543ab53..16f0e9a893 100644 --- a/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.c +++ b/src/mod/xml_int/mod_xml_scgi/mod_xml_scgi.c @@ -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;