aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_user.c3
-rw-r--r--src/s_conf.c22
-rw-r--r--src/win32/gui.c2
-rw-r--r--src/win32/service.c2
4 files changed, 10 insertions, 19 deletions
diff --git a/src/modules/m_user.c b/src/modules/m_user.c
index d0b9f4f1f..6c9a33a79 100644
--- a/src/modules/m_user.c
+++ b/src/modules/m_user.c
@@ -210,7 +210,8 @@ DLLFUNC CMD_FUNC(m_user)
if (USE_BAN_VERSION && MyConnect(sptr))
sendto_one(sptr, ":IRC!IRC@%s PRIVMSG %s :\1VERSION\1",
me.name, sptr->name);
-
+ if (strlen(username) > USERLEN)
+ username[USERLEN] = '\0'; /* cut-off */
return(
register_user(cptr, sptr, sptr->name, username, umodex,
virthost,ip));
diff --git a/src/s_conf.c b/src/s_conf.c
index 8946cdeb7..4981e9ac8 100644
--- a/src/s_conf.c
+++ b/src/s_conf.c
@@ -2734,25 +2734,15 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost, char *usernam
Debug((DEBUG_DNS, "a_il: %s->%s", sockhost, fullname));
if (index(aconf->hostname, '@'))
{
- /*
- * Doing strlcpy / strlcat here
- * would simply be a waste. We are
- * ALREADY sure that it is proper
- * lengths
- */
if (aconf->flags.noident)
- strcpy(uhost, username);
+ strlcpy(uhost, username, sizeof(uhost));
else
- strcpy(uhost, cptr->username);
- strcat(uhost, "@");
+ strlcpy(uhost, cptr->username, sizeof(uhost));
+ strlcat(uhost, "@", sizeof(uhost));
}
else
*uhost = '\0';
- /*
- * Same here as above
- * -Stskeeps
- */
- strncat(uhost, fullname, sizeof(uhost) - strlen(uhost));
+ strlcat(uhost, fullname, sizeof(uhost));
if (!match(aconf->hostname, uhost))
goto attach;
}
@@ -2763,11 +2753,11 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost, char *usernam
strncpyzt(uhost, username, sizeof(uhost));
else
strncpyzt(uhost, cptr->username, sizeof(uhost));
- (void)strcat(uhost, "@");
+ (void)strlcat(uhost, "@", sizeof(uhost));
}
else
*uhost = '\0';
- (void)strncat(uhost, sockhost, sizeof(uhost) - strlen(uhost));
+ strlcat(uhost, sockhost, sizeof(uhost));
/* Check the IP */
if (match_ip(cptr->ip, uhost, aconf->ip, aconf->netmask))
goto attach;
diff --git a/src/win32/gui.c b/src/win32/gui.c
index 27b1387da..7190041a5 100644
--- a/src/win32/gui.c
+++ b/src/win32/gui.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#define WIN32_VERSION BASE_VERSION PATCH1 PATCH2 PATCH3 PATCH4
+#define WIN32_VERSION BASE_VERSION PATCH1 PATCH2 PATCH3 PATCH4 PATCH5
#include "resource.h"
#include "version.h"
#include "setup.h"
diff --git a/src/win32/service.c b/src/win32/service.c
index 3ac88858f..60b24e9b7 100644
--- a/src/win32/service.c
+++ b/src/win32/service.c
@@ -35,7 +35,7 @@ SERVICE_STATUS_HANDLE IRCDStatusHandle;
BOOL IsService = FALSE;
extern OSVERSIONINFO VerInfo;
-#define WIN32_VERSION BASE_VERSION PATCH1 PATCH2 PATCH3 PATCH4
+#define WIN32_VERSION BASE_VERSION PATCH1 PATCH2 PATCH3 PATCH4 PATCH5
/* Places the service in the STOPPED state
* Parameters: