提交 455ed10e authored 作者: Michael Jerris's avatar Michael Jerris

CID:1214130 Buffer not null terminated

上级 ebc0a99f
......@@ -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;
......
......@@ -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;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论