mirror of
https://github.com/MariaDB/server.git
synced 2026-05-06 15:15:34 +02:00
Handle errors returned by system crypt() in ENCRYPT(). (Bug #13619)
mysql-test/r/func_crypt.result: Add new results mysql-test/t/func_crypt.test: Add new regression test sql/item_strfunc.cc: Handle NULL result from call to crypt().
This commit is contained in:
parent
78f5997ade
commit
041123bade
3 changed files with 16 additions and 1 deletions
|
|
@ -1497,7 +1497,13 @@ String *Item_func_encrypt::val_str(String *str)
|
|||
salt_ptr= salt_str->c_ptr();
|
||||
}
|
||||
pthread_mutex_lock(&LOCK_crypt);
|
||||
char *tmp=crypt(res->c_ptr(),salt_ptr);
|
||||
char *tmp= crypt(res->c_ptr(),salt_ptr);
|
||||
if (!tmp)
|
||||
{
|
||||
pthread_mutex_unlock(&LOCK_crypt);
|
||||
null_value= 1;
|
||||
return 0;
|
||||
}
|
||||
str->set(tmp,(uint) strlen(tmp),res->charset());
|
||||
str->copy();
|
||||
pthread_mutex_unlock(&LOCK_crypt);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue