mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
sql/password.c: check for buffer overflow in check_scramble_323 (BUG#7187)
This commit is contained in:
parent
68174d7ace
commit
d7acab1530
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue