summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-08-25 12:34:42 -0700
committerunknown <jimw@mysql.com>2005-08-25 12:34:42 -0700
commit0a724d8b09527bb3bb9eb1f814511f3138568563 (patch)
treeaca9638a6b892c5bca9a84b9d4629a6de12f449b /sql/item_strfunc.cc
parent0cedaee07254b388f7f63ce6a75d0e949a35192e (diff)
downloadmariadb-git-0a724d8b09527bb3bb9eb1f814511f3138568563.tar.gz
Fix crash in DES_DECRYPT(NULL). (Bug #12757)
sql/item_strfunc.cc: Don't call res->length() when res may be NULL because args[0] is a NULL.
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index d0650a1ce11..6962ba7c4ac 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -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