summaryrefslogtreecommitdiff
path: root/sql/password.c
diff options
context:
space:
mode:
authormonty@mishka.local <>2004-12-22 13:54:39 +0200
committermonty@mishka.local <>2004-12-22 13:54:39 +0200
commit4f4bbfc279800923299df1fefeb2fcd299fcde90 (patch)
tree8e5f08b17957f896c2d4e931e60b57d99c260ed6 /sql/password.c
parent198dc7a8ec6e220c348bb47e59a2ac7532be18b8 (diff)
parent98f2a83539735f1a69680195290adcf02861f073 (diff)
downloadmariadb-git-4f4bbfc279800923299df1fefeb2fcd299fcde90.tar.gz
Merge with 4.1
Diffstat (limited to 'sql/password.c')
-rw-r--r--sql/password.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/password.c b/sql/password.c
index e2f7e14d39f..79675ade30b 100644
--- a/sql/password.c
+++ b/sql/password.c
@@ -211,12 +211,13 @@ check_scramble_323(const char *scrambled, const char *message,
ulong hash_message[2];
char buff[16],*to,extra; /* Big enough for check */
const char *pos;
-
+
hash_password(hash_message, message, SCRAMBLE_LENGTH_323);
randominit(&rand_st,hash_pass[0] ^ hash_message[0],
hash_pass[1] ^ hash_message[1]);
to=buff;
- for (pos=scrambled ; *pos ; pos++)
+ DBUG_ASSERT(sizeof(buff) > SCRAMBLE_LENGTH_323);
+ for (pos=scrambled ; *pos && to < buff+sizeof(buff) ; pos++)
*to++=(char) (floor(my_rnd(&rand_st)*31)+64);
if (pos-scrambled != SCRAMBLE_LENGTH_323)
return 1;