1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 17:23:14 +02:00

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
This commit is contained in:
cyberbotx
2009-10-20 04:34:03 +00:00
parent 0d3ec454de
commit 0b3824c86a
21 changed files with 125 additions and 139 deletions
+3 -3
View File
@@ -154,7 +154,7 @@ static char currentpass[1024];
/* PASS */
void inspircd_cmd_pass(const char *pass)
{
strncpy(currentpass, pass, 1024);
strlcpy(currentpass, pass, sizeof(currentpass));
}
@@ -568,8 +568,8 @@ int anope_event_fjoin(const char *source, int ac, const char **av)
}
}
}
strncat(nicklist, prefixandnick, 513);
strncat(nicklist, " ", 513);
strlcat(nicklist, prefixandnick, sizeof(nicklist));
strlcat(nicklist, " ", sizeof(nicklist));
delete [] curnick_real;
nlen = 0;
}
+4 -4
View File
@@ -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<uint32 *>(&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;
+3 -3
View File
@@ -822,7 +822,7 @@ int anope_event_sethost(const char *source, int ac, const char **av)
/* If a user has a custom host and a server splits and reconnects
* Unreal does not send the users cloaked host to Anope.. so we do not know it.
* However, they will be +t if this is the case, so we will set their vhost
* However, they will be +t if this is the case, so we will set their vhost
* to the sethost value (which really is their vhost) and clear the chost.
* The chost will be request later (if needed) - Adam
*/
@@ -1024,7 +1024,7 @@ int anope_event_userhost(const char *source, int ac, const char **av)
*/
if (ac < 2 || !av[1] || !*av[1])
return MOD_CONT;
std::string reply = av[1];
std::string user = std::string(reply.begin(), std::find(reply.begin(), reply.end(), '='));
if (user[user.length() - 1] == '*')
@@ -1130,7 +1130,7 @@ bool ChannelModeFlood::IsValid(const char *value)
if (*value != ':' && strtoul((*value == '*' ? value + 1 : value), &dp, 10) > 0 && *dp == ':' && *(++dp) && strtoul(dp, &end, 10) > 0 && !*end) return 1;
else {
/* '['<number><1 letter>[optional: '#'+1 letter],[next..]']'':'<number> */
strncpy(xbuf, value, sizeof(xbuf));
strlcpy(xbuf, value, sizeof(xbuf));
p2 = strchr(xbuf + 1, ']');
if (!p2) return 0;
*p2 = '\0';