summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2016-12-03 11:02:28 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2016-12-03 11:02:28 +0400
commite8c419570f7980f123028eb7cc2c226b2bd814f5 (patch)
tree60620aec4cb9835486bc2f1a98a444fa8da67402 /sql/item_jsonfunc.cc
parentb28626e842f94658b3fb9bd322d42cb5355222f4 (diff)
downloadmariadb-git-e8c419570f7980f123028eb7cc2c226b2bd814f5.tar.gz
MDEV-11442 Server crashes in String::length / parse_one_or_all /Item_func_json_contains_path::val_int
Didn't expect 'one_or_all' parameter to be NULL.
Diffstat (limited to 'sql/item_jsonfunc.cc')
-rw-r--r--sql/item_jsonfunc.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index 71042021fbd..42ad5470965 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -725,7 +725,8 @@ static int parse_one_or_all(Item *ooa_arg,
{
char buff[20];
String *res, tmp(buff, sizeof(buff), &my_charset_bin);
- res= ooa_arg->val_str(&tmp);
+ if ((res= ooa_arg->val_str(&tmp)) == NULL)
+ return TRUE;
*mode_one=eq_ascii_string(res->charset(), "one",
res->ptr(), res->length());
if (!*mode_one)