From: Michael Jerris Date: Fri, 16 May 2014 14:37:43 +0000 (+0000) Subject: CID:1214130 Buffer not null terminated X-Git-Tag: v1.4.4~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=455ed10e40e1258dfa690487847b9a72d34a4947;p=thirdparty%2Ffreeswitch.git CID:1214130 Buffer not null terminated --- 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;