]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
CID:1214140 Buffer not null terminated, make sure hostname is always null terminated
authorMichael Jerris <mike@jerris.com>
Thu, 15 May 2014 12:38:41 +0000 (12:38 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 15 May 2014 12:38:41 +0000 (12:38 +0000)
src/mod/applications/mod_db/mod_db.c

index 0a5e9fe61d2c4fab64c812df4e1a9e4e19d2dea3..58a5a25616db5f070b0b56800b2926eb20a9c8b6 100644 (file)
@@ -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;