Commit 663d0bbd authored by jimw@mysql.com's avatar jimw@mysql.com

Fix crash in DES_DECRYPT(NULL). (Bug #12757)

parent c2b8f4ad
......@@ -472,11 +472,11 @@ String *Item_func_des_decrypt::val_str(String *str)
struct st_des_keyblock keyblock;
struct st_des_keyschedule keyschedule;
String *res= args[0]->val_str(str);
uint length=res->length(),tail;
uint length,tail;
if ((null_value=args[0]->null_value))
if ((null_value= args[0]->null_value))
return 0;
length=res->length();
length= res->length();
if (length < 9 || (length % 8) != 1 || !((*res)[0] & 128))
return res; // Skip decryption if not encrypted
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment