提交 619b31e1 authored 作者: Michael Jerris's avatar Michael Jerris

CID:1214140 Buffer not null terminated, make sure hostname is always null terminated

上级 16805187
......@@ -642,7 +642,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_db_load)
switch_limit_interface_t *limit_interface;
memset(&globals, 0, sizeof(globals));
strncpy(globals.hostname, switch_core_get_switchname(), sizeof(globals.hostname));
strncpy(globals.hostname, switch_core_get_switchname(), sizeof(globals.hostname) -1 );
globals.pool = pool;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论