From 619b31e1e84698453e0bfc9e5433853fe92531ae Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 15 May 2014 12:38:41 +0000 Subject: [PATCH] CID:1214140 Buffer not null terminated, make sure hostname is always null terminated --- src/mod/applications/mod_db/mod_db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_db/mod_db.c b/src/mod/applications/mod_db/mod_db.c index 0a5e9fe61d..58a5a25616 100644 --- a/src/mod/applications/mod_db/mod_db.c +++ b/src/mod/applications/mod_db/mod_db.c @@ -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;