Fix out-of-bounds error in cryptit() found by Coverity.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@240 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -2826,8 +2826,8 @@ static char saltChars[] =
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHJIKLMNOPQRSTUVWXYZ./";
|
||||
char *cpass = (char *)string;
|
||||
char salt[3];
|
||||
salt[0] = saltChars[random_number(0) % 64];
|
||||
salt[1] = saltChars[random_number(0) % 64];
|
||||
salt[0] = saltChars[random_number(0) % sizeof(saltChars)];
|
||||
salt[1] = saltChars[random_number(0) % sizeof(saltChars)];
|
||||
salt[2] = 0;
|
||||
#if !defined(WINNT)
|
||||
cpass = crypt(string, salt);
|
||||
|
||||
Reference in New Issue
Block a user