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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
921fd529
Commit
921fd529
authored
Oct 08, 2010
by
Tor Didriksen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#57209 valgrind + Assertion failed: dst > buf
Buffer overrun when trying to format DBL_MAX
parent
b2ccb7d0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+7
-0
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+6
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+3
-2
No files found.
mysql-test/r/func_math.result
View file @
921fd529
...
@@ -600,3 +600,10 @@ NULL
...
@@ -600,3 +600,10 @@ NULL
SELECT -9223372036854775808 MOD -1;
SELECT -9223372036854775808 MOD -1;
-9223372036854775808 MOD -1
-9223372036854775808 MOD -1
0
0
#
# Bug #57209 valgrind + Assertion failed: dst > buf
#
SELECT floor(log10(format(concat_ws(5445796E25, 5306463, 30837), -358821)))
as foo;
foo
2
mysql-test/t/func_math.test
View file @
921fd529
...
@@ -458,3 +458,9 @@ SELECT 2 DIV -2;
...
@@ -458,3 +458,9 @@ SELECT 2 DIV -2;
SELECT
-
(
1
DIV
0
);
SELECT
-
(
1
DIV
0
);
# Crashed the server with SIGFPE before the bugfix
# Crashed the server with SIGFPE before the bugfix
SELECT
-
9223372036854775808
MOD
-
1
;
SELECT
-
9223372036854775808
MOD
-
1
;
--
echo
#
--
echo
# Bug #57209 valgrind + Assertion failed: dst > buf
--
echo
#
SELECT
floor
(
log10
(
format
(
concat_ws
(
5445796
E25
,
5306463
,
30837
),
-
358821
)))
as
foo
;
sql/item_strfunc.cc
View file @
921fd529
...
@@ -2299,7 +2299,8 @@ String *Item_func_format::val_str_ascii(String *str)
...
@@ -2299,7 +2299,8 @@ String *Item_func_format::val_str_ascii(String *str)
if
(
lc
->
grouping
[
0
]
>
0
&&
if
(
lc
->
grouping
[
0
]
>
0
&&
str_length
>=
dec_length
+
1
+
lc
->
grouping
[
0
])
str_length
>=
dec_length
+
1
+
lc
->
grouping
[
0
])
{
{
char
buf
[
DECIMAL_MAX_STR_LENGTH
*
2
];
/* 2 - in the worst case when grouping=1 */
/* We need space for ',' between each group of digits as well. */
char
buf
[
2
*
FLOATING_POINT_BUFFER
];
int
count
;
int
count
;
const
char
*
grouping
=
lc
->
grouping
;
const
char
*
grouping
=
lc
->
grouping
;
char
sign_length
=
*
str
->
ptr
()
==
'-'
?
1
:
0
;
char
sign_length
=
*
str
->
ptr
()
==
'-'
?
1
:
0
;
...
@@ -2323,7 +2324,7 @@ String *Item_func_format::val_str_ascii(String *str)
...
@@ -2323,7 +2324,7 @@ String *Item_func_format::val_str_ascii(String *str)
count will be initialized to -1 and
count will be initialized to -1 and
we'll never get into this "if" anymore.
we'll never get into this "if" anymore.
*/
*/
if
(
!
count
)
if
(
count
==
0
)
{
{
*--
dst
=
lc
->
thousand_sep
;
*--
dst
=
lc
->
thousand_sep
;
if
(
grouping
[
1
])
if
(
grouping
[
1
])
...
...
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