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

This commit is contained in:
Michael Jerris 2014-05-15 12:38:41 +00:00
parent 16805187ec
commit 619b31e1e8
1 changed files with 1 additions and 1 deletions

View File

@ -642,7 +642,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_db_load)
switch_limit_interface_t *limit_interface; switch_limit_interface_t *limit_interface;
memset(&globals, 0, sizeof(globals)); 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; globals.pool = pool;