From 0b3824c86a99354d06339b95e40515de762d65f7 Mon Sep 17 00:00:00 2001 From: cyberbotx Date: Tue, 20 Oct 2009 04:34:03 +0000 Subject: Apply some changes based on possible "flaws" found with flawfinder. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2574 5417fbe8-f217-4b02-8779-1006273d7864 --- src/modules/hs_request.c | 4 ++-- src/modules/os_ignore_db.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/modules') diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c index 30949d9e7..b982375db 100644 --- a/src/modules/hs_request.c +++ b/src/modules/hs_request.c @@ -826,9 +826,9 @@ void req_send_memos(User *u, char *vIdent, char *vHost) return; if (vIdent) - sprintf(host, "%s@%s", vIdent, vHost); + snprintf(host, sizeof(host), "%s@%s", vIdent, vHost); else - sprintf(host, "%s", vHost); + snprintf(host, sizeof(host), "%s", vHost); if (HSRequestMemoOper == 1) { diff --git a/src/modules/os_ignore_db.c b/src/modules/os_ignore_db.c index b393e5cd1..d5487b360 100644 --- a/src/modules/os_ignore_db.c +++ b/src/modules/os_ignore_db.c @@ -478,12 +478,12 @@ void fill_db_ptr(DBFile *dbptr, int version, int core_version, dbptr->db_version = version; dbptr->core_db_version = core_version; if (!service) - strcpy(dbptr->service, service); + strlcpy(dbptr->service, service, sizeof(dbptr->service)); else - strcpy(dbptr->service, ""); + strlcpy(dbptr->service, "", sizeof(dbptr->service)); - strcpy(dbptr->filename, filename); - snprintf(dbptr->temp_name, 261, "%s.temp", filename); + strlcpy(dbptr->filename, filename, sizeof(dbptr->filename)); + snprintf(dbptr->temp_name, sizeof(dbptr->temp_name), "%s.temp", filename); return; } -- cgit