diff options
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | src/core/enc_none.c | 6 | ||||
-rw-r--r-- | src/core/ns_register.c | 14 | ||||
-rw-r--r-- | version.log | 7 |
4 files changed, 17 insertions, 11 deletions
@@ -53,6 +53,7 @@ Anope Version S V N 08/28 F Replaced static count in login/opernews help. [#882] 08/28 F Updated help on ChanServ AKICK. [#879] 09/01 F Fixed crashbug in cs_access. [#932] +09/02 F Fixed bug in enc_none in combination with truncated pass. [#934] Provided by Robin Burchell <w00t@inspircd.org> - 2008 08/08 F Strict warnings in send.c from comparing address of non-ptr [ #00] diff --git a/src/core/enc_none.c b/src/core/enc_none.c index 0249d4c6c..2e6316648 100644 --- a/src/core/enc_none.c +++ b/src/core/enc_none.c @@ -41,10 +41,10 @@ void AnopeFini(void) { int plain_encrypt(const char *src,int len,char *dest,int size) { if(size>=len) { - memset(dest,0,size); + memset(dest,0,size); strncpy(dest,src,len); dest[len] = '\0'; - return 0; + return 0; } return -1; } @@ -61,7 +61,7 @@ int plain_encrypt_check_len(int passlen, int bufsize) { } int plain_decrypt(const char *src, char *dest, int size) { - memset(dest,0,size); + memset(dest,0,size+1); strncpy(dest,src,size); return 1; } diff --git a/src/core/ns_register.c b/src/core/ns_register.c index d2e8ea610..5ee5f6542 100644 --- a/src/core/ns_register.c +++ b/src/core/ns_register.c @@ -189,7 +189,7 @@ int do_register(User * u) notice_lang(s_NickServ, u, MAIL_X_INVALID, email); } else { if (strlen(pass) > PASSMAX) { - pass[PASSMAX] = 0; + pass[PASSMAX] = '\0'; notice_lang(s_NickServ, u, PASSWORD_TRUNCATED, PASSMAX); } for (idx = 0; idx < 9; idx++) { @@ -307,7 +307,7 @@ int do_confirm(User * u) if (na) { int i; char tsbuf[16]; - char tmp_pass[PASSMAX]; + char tmp_pass[PASSMAX]; len = strlen(pass); na->nc->pass = smalloc(PASSMAX); @@ -366,19 +366,19 @@ int do_confirm(User * u) notice_lang(s_NickServ, u, NICK_REGISTERED_NO_MASK, u->nick); send_event(EVENT_NICK_REGISTERED, 1, u->nick); - - if(enc_decrypt(na->nc->pass,tmp_pass,PASSMAX)==1) + + if(enc_decrypt(na->nc->pass,tmp_pass,PASSMAX)==1) notice_lang(s_NickServ, u, NICK_PASSWORD_IS, tmp_pass); u->lastnickreg = time(NULL); if (ircd->modeonreg) { len = strlen(ircd->modeonreg); strncpy(modes,ircd->modeonreg,512); - if(ircd->rootmodeonid && is_services_root(u)) { + if(ircd->rootmodeonid && is_services_root(u)) { strncat(modes,ircd->rootmodeonid,512-len); - } else if(ircd->adminmodeonid && is_services_admin(u)) { + } else if(ircd->adminmodeonid && is_services_admin(u)) { strncat(modes,ircd->adminmodeonid,512-len); - } else if(ircd->opermodeonid && is_services_oper(u)) { + } else if(ircd->opermodeonid && is_services_oper(u)) { strncat(modes,ircd->opermodeonid,512-len); } diff --git a/version.log b/version.log index b9ca9ac57..3451ccdaa 100644 --- a/version.log +++ b/version.log @@ -9,10 +9,15 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="21" VERSION_EXTRA="-svn" -VERSION_BUILD="1423" +VERSION_BUILD="1424" # $Log$ # +# BUILD : 1.7.21 (1424) +# BUGS : 934 +# NOTES : Fixed bogus password being returned by enc_none when password +# was truncated. +# # BUILD : 1.7.21 (1423) # BUGS : 932 # NOTES : Fixed crashbug in cs_access. |