Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
c865f491
Commit
c865f491
authored
Oct 21, 2005
by
pem@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Post-review fix.
parent
ca5e435f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
sql/sp_head.cc
sql/sp_head.cc
+4
-3
No files found.
sql/sp_head.cc
View file @
c865f491
...
...
@@ -295,7 +295,7 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type,
/*
For some functions, 's' is now pointing to an argument of the
function, which might be a local variable that i
t
to be reused.
function, which might be a local variable that i
s
to be reused.
In this case, new(reuse, &rsize) below will call the destructor
and 's' ends up pointing to freed memory.
A somewhat ugly fix is to simply copy the string to our local one
...
...
@@ -304,7 +304,8 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type,
*/
if
(
reuse
&&
s
!=
&
tmp
&&
s
!=
&
it
->
str_value
)
{
tmp
.
copy
(
s
->
c_ptr
(),
s
->
length
(),
it
->
collation
.
collation
);
if
(
tmp
.
copy
((
const
String
)(
*
s
)))
DBUG_RETURN
(
NULL
);
s
=
&
tmp
;
}
...
...
@@ -338,7 +339,7 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type,
return_null_item:
CREATE_ON_CALLERS_ARENA
(
it
=
new
(
reuse
,
&
rsize
)
Item_null
(),
use_callers_arena
,
&
backup_arena
);
use_callers_arena
,
&
backup_arena
);
end:
it
->
rsize
=
rsize
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment