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
a2de6043
Commit
a2de6043
authored
Mar 17, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ASAN error in CONNECT engine
don't strcpy a string to itself
parent
2ed882f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
storage/connect/value.cpp
storage/connect/value.cpp
+8
-2
No files found.
storage/connect/value.cpp
View file @
a2de6043
...
@@ -1627,6 +1627,12 @@ int TYPVAL<PSZ>::CompareValue(PVAL vp)
...
@@ -1627,6 +1627,12 @@ int TYPVAL<PSZ>::CompareValue(PVAL vp)
return
(
n
>
0
)
?
1
:
(
n
<
0
)
?
-
1
:
0
;
return
(
n
>
0
)
?
1
:
(
n
<
0
)
?
-
1
:
0
;
}
// end of CompareValue
}
// end of CompareValue
static
inline
void
v_strcpy
(
char
*
dest
,
const
char
*
src
)
{
if
(
dest
!=
src
)
strcpy
(
dest
,
src
);
}
/***********************************************************************/
/***********************************************************************/
/* Compute a function on a string. */
/* Compute a function on a string. */
/***********************************************************************/
/***********************************************************************/
...
@@ -1651,11 +1657,11 @@ bool TYPVAL<PSZ>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
...
@@ -1651,11 +1657,11 @@ bool TYPVAL<PSZ>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
break
;
break
;
case
OP_MIN
:
case
OP_MIN
:
assert
(
np
==
2
);
assert
(
np
==
2
);
strcpy
(
Strp
,
(
strcmp
(
p
[
0
],
p
[
1
])
<
0
)
?
p
[
0
]
:
p
[
1
]);
v_
strcpy
(
Strp
,
(
strcmp
(
p
[
0
],
p
[
1
])
<
0
)
?
p
[
0
]
:
p
[
1
]);
break
;
break
;
case
OP_MAX
:
case
OP_MAX
:
assert
(
np
==
2
);
assert
(
np
==
2
);
strcpy
(
Strp
,
(
strcmp
(
p
[
0
],
p
[
1
])
>
0
)
?
p
[
0
]
:
p
[
1
]);
v_
strcpy
(
Strp
,
(
strcmp
(
p
[
0
],
p
[
1
])
>
0
)
?
p
[
0
]
:
p
[
1
]);
break
;
break
;
default:
default:
// sprintf(g->Message, MSG(BAD_EXP_OPER), op);
// sprintf(g->Message, MSG(BAD_EXP_OPER), op);
...
...
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