diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-20 04:34:03 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-20 04:34:03 +0000 |
commit | 0b3824c86a99354d06339b95e40515de762d65f7 (patch) | |
tree | 133edb1fb478a97674cb63e1f89a4762053d24e2 /src/modulemanager.cpp | |
parent | 0d3ec454de486da5cbc292f7e694ee8ab7e4fae0 (diff) |
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
Diffstat (limited to 'src/modulemanager.cpp')
-rw-r--r-- | src/modulemanager.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp index 68609421b..35a2280a8 100644 --- a/src/modulemanager.cpp +++ b/src/modulemanager.cpp @@ -45,15 +45,11 @@ static int moduleCopyFile(const char *name, const char *output) int srcfp; #endif char input[4096]; - int len; - - strncpy(input, services_dir.c_str(), 4095); - len = strlen(input); - strncat(input, "/modules/", 4095 - len); /* Get full path with module extension */ - len = strlen(input); - strncat(input, name, 4095 - len); - len = strlen(output); - strncat(input, MODULE_EXT, 4095 - len); + + strlcpy(input, services_dir.c_str(), sizeof(input)); + strlcat(input, "/modules/", sizeof(input)); /* Get full path with module extension */ + strlcat(input, name, sizeof(input)); + strlcat(input, MODULE_EXT, sizeof(input)); #ifndef _WIN32 if ((srcfp = mkstemp(const_cast<char *>(output))) == -1) |