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/wildcard.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/wildcard.cpp')
-rw-r--r-- | src/wildcard.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/wildcard.cpp b/src/wildcard.cpp index b2d85afe1..ce4d7d314 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -21,17 +21,17 @@ void Delete(char* str,int pos) { char moo[MAXBUF]; - strcpy(moo,str); + strlcpy(moo,str,MAXBUF); moo[pos] = '\0'; - strcpy(str,moo); - strcat(str,moo+pos+1); + strlcpy(str,moo,MAXBUF); + strlcat(str,moo+pos+1,MAXBUF); } void Insert(char* substr,char* str,int pos) { std::string a = str; a.insert(pos,substr); - strcpy(str,a.c_str()); + strlcpy(str,a.c_str(),MAXBUF); } @@ -57,7 +57,7 @@ if ((strstr(mask,"*")==0) && (strlen(literal) != strlen(mask))) if ((mask[I]=='*') && (MWC==0)) { - strcpy(OldM,mask); + strlcpy(OldM,mask,MAXBUF); Delete(mask,I); @@ -69,7 +69,7 @@ if ((strstr(mask,"*")==0) && (strlen(literal) != strlen(mask))) Insert("?",mask,I); } - strcpy(mask,OldM); + strlcpy(mask,OldM,MAXBUF); Delete(mask,I); Insert("?",mask,I); } @@ -96,8 +96,8 @@ bool match(const char* literal, const char* mask) char L[10240]; char M[10240]; MWC = 0; - strncpy(L,literal,10240); - strncpy(M,mask,10240); + strlcpy(L,literal,10240); + strlcpy(M,mask,10240); strlower(L); strlower(M); match2(L,M); |