summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2017-12-25 08:10:48 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2017-12-25 08:10:48 +0400
commitf0f3b6549a5924a194e8ce56a0c47443acbb506e (patch)
tree0c1dc626c77b05a5c58c25a702f56f453905180e /sql/item_jsonfunc.cc
parent6e7ca6b0b29a732390f2d50902ef7f6db66989ce (diff)
downloadmariadb-git-f0f3b6549a5924a194e8ce56a0c47443acbb506e.tar.gz
MDEV-13970 crash in Item_func_json_extract::read_json.
Item_func_json_extract::val_int fixed. It wasn't tested yet as it's called in exotic cases only.
Diffstat (limited to 'sql/item_jsonfunc.cc')
-rw-r--r--sql/item_jsonfunc.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index ff062b81a2e..794831ae1a5 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -781,10 +781,10 @@ String *Item_func_json_extract::read_json(String *str,
{
str->set_charset(js->charset());
str->length(0);
- }
- if (possible_multiple_values && str->append("[", 1))
- goto error;
+ if (possible_multiple_values && str->append("[", 1))
+ goto error;
+ }
json_get_path_start(&je, js->charset(),(const uchar *) js->ptr(),
(const uchar *) js->ptr() + js->length(), &p);