Skip to content

Commit 4ea181e

Browse files
author
Tor Didriksen
committed
Bug#36684463 crash in my_convert_internal()
Do not return pointer to stack data, copy the result to 'tmp_value' which is in some mem_root (on the heap). Change-Id: I909e1faa6d175074f2ff925cce2d046e5f8e3a16 (cherry picked from commit 6d49e032d2fda8ebf5bb5033b3335a8b44831d0d)
1 parent a05678a commit 4ea181e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sql/item_xmlfunc.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,13 +2529,14 @@ String *Item_func_xml_update::val_str(String *str) {
25292529

25302530
const MY_XML_NODE *node = &pxml.at(nodeset.at(0).num);
25312531

2532-
if (!node->level) {
2532+
if (node->level == 0) {
25332533
/*
25342534
Root element, without NameTest:
25352535
UpdateXML(xml, '/', 'replacement');
25362536
Just return the replacement string.
25372537
*/
2538-
return rep;
2538+
tmp_value.copy(*rep);
2539+
return &tmp_value;
25392540
}
25402541

25412542
tmp_value.length(0);

0 commit comments

Comments
 (0)