diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-09-11 20:10:05 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-09-11 20:10:05 +0000 |
commit | e7f0a0fb7edf96abbddf72eadb490b5eb22447ec (patch) | |
tree | 67c9bfeadf64d1622e8ed060a55969ddb6452834 /src/xline.cpp | |
parent | ea36f2bb1b8b1bf03b8615672866f93697caff75 (diff) |
Security audit based on RATS output
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@855 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/xline.cpp')
-rw-r--r-- | src/xline.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/xline.cpp b/src/xline.cpp index 2c273b477..721a027da 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -121,7 +121,7 @@ namespace nspace { char a[MAXBUF]; static struct hash<const char *> strhash; - strcpy(a,s.c_str()); + strlcpy(a,s.c_str(),MAXBUF); strlower(a); return strhash(a); } @@ -135,8 +135,8 @@ struct StrHashComp bool operator()(const string& s1, const string& s2) const { char a[MAXBUF],b[MAXBUF]; - strcpy(a,s1.c_str()); - strcpy(b,s2.c_str()); + strlcpy(a,s1.c_str(),MAXBUF); + strlcpy(b,s2.c_str(),MAXBUF); return (strcasecmp(a,b) == 0); } @@ -223,9 +223,9 @@ void add_gline(long duration, char* source, char* reason, char* hostmask) del_gline(hostmask); GLine item; item.duration = duration; - strncpy(item.hostmask,hostmask,MAXBUF); - strncpy(item.reason,reason,MAXBUF); - strncpy(item.source,source,MAXBUF); + strlcpy(item.hostmask,hostmask,MAXBUF); + strlcpy(item.reason,reason,MAXBUF); + strlcpy(item.source,source,MAXBUF); item.n_matches = 0; item.set_time = time(NULL); glines.push_back(item); @@ -238,9 +238,9 @@ void add_qline(long duration, char* source, char* reason, char* nickname) del_qline(nickname); QLine item; item.duration = duration; - strncpy(item.nick,nickname,MAXBUF); - strncpy(item.reason,reason,MAXBUF); - strncpy(item.source,source,MAXBUF); + strlcpy(item.nick,nickname,MAXBUF); + strlcpy(item.reason,reason,MAXBUF); + strlcpy(item.source,source,MAXBUF); item.n_matches = 0; item.is_global = false; item.set_time = time(NULL); @@ -254,9 +254,9 @@ void add_zline(long duration, char* source, char* reason, char* ipaddr) del_zline(ipaddr); ZLine item; item.duration = duration; - strncpy(item.ipaddr,ipaddr,MAXBUF); - strncpy(item.reason,reason,MAXBUF); - strncpy(item.source,source,MAXBUF); + strlcpy(item.ipaddr,ipaddr,MAXBUF); + strlcpy(item.reason,reason,MAXBUF); + strlcpy(item.source,source,MAXBUF); item.n_matches = 0; item.is_global = false; item.set_time = time(NULL); @@ -270,9 +270,9 @@ void add_kline(long duration, char* source, char* reason, char* hostmask) del_kline(hostmask); KLine item; item.duration = duration; - strncpy(item.hostmask,hostmask,MAXBUF); - strncpy(item.reason,reason,MAXBUF); - strncpy(item.source,source,MAXBUF); + strlcpy(item.hostmask,hostmask,MAXBUF); + strlcpy(item.reason,reason,MAXBUF); + strlcpy(item.source,source,MAXBUF); item.n_matches = 0; item.set_time = time(NULL); klines.push_back(item); |