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/protocol/inspircd12.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/protocol/inspircd12.cpp') diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp index bdc6e999a..0f4d7c42f 100644 --- a/src/protocol/inspircd12.cpp +++ b/src/protocol/inspircd12.cpp @@ -159,7 +159,7 @@ static char currentpass[1024]; /* PASS */ void inspircd_cmd_pass(const char *pass) { - strncpy(currentpass, pass, 1024); + strlcpy(currentpass, pass, sizeof(currentpass)); } @@ -645,8 +645,8 @@ int anope_event_fjoin(const char *source, int ac, const char **av) // Much as I hate goto.. I can't `break 2' to get here.. XXX ugly endnick: - strncat(nicklist, prefixandnick, 513); - strncat(nicklist, " ", 513); + strlcat(nicklist, prefixandnick, sizeof(nicklist)); + strlcat(nicklist, " ", sizeof(nicklist)); delete [] curnick_real; nlen = 0; } @@ -901,7 +901,7 @@ int anope_event_uid(const char *source, int ac, const char **av) Server *s = findserver_uid(servlist, source); uint32 *ad = reinterpret_cast(&addy); int ts = strtoul(av[1], NULL, 10); - + /* Check if the previously introduced user was Id'd for the nickgroup of the nick he s currently using. * If not, validate the user. ~ Viper*/ user = prev_u_intro; -- cgit