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
a50170dd
Commit
a50170dd
authored
Sep 09, 2013
by
Tor Didriksen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#17296644 CONV(X, INT_MIN, INT_MIN) SEGFAULTS THE SERVER
Do not call abs(INT_MIN) as the result is undefined.
parent
90ecf4eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
configure.cmake
configure.cmake
+4
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+3
-1
No files found.
configure.cmake
View file @
a50170dd
...
...
@@ -147,6 +147,10 @@ IF(UNIX)
SET
(
CMAKE_REQUIRED_LIBRARIES
${
LIBM
}
${
LIBNSL
}
${
LIBBIND
}
${
LIBCRYPT
}
${
LIBSOCKET
}
${
LIBDL
}
${
CMAKE_THREAD_LIBS_INIT
}
${
LIBRT
}
)
# Need explicit pthread for gcc -fsanitize=address
IF
(
CMAKE_USE_PTHREADS_INIT AND CMAKE_C_FLAGS MATCHES
"-fsanitize="
)
SET
(
CMAKE_REQUIRED_LIBRARIES
${
CMAKE_REQUIRED_LIBRARIES
}
pthread
)
ENDIF
()
LIST
(
LENGTH CMAKE_REQUIRED_LIBRARIES required_libs_length
)
IF
(
${
required_libs_length
}
GREATER 0
)
...
...
sql/item_strfunc.cc
View file @
a50170dd
/*
Copyright (c) 2000, 201
1
, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2000, 201
3
, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -2928,7 +2928,9 @@ String *Item_func_conv::val_str(String *str)
int
to_base
=
(
int
)
args
[
2
]
->
val_int
();
int
err
;
// Note that abs(INT_MIN) is undefined.
if
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
||
args
[
2
]
->
null_value
||
from_base
==
INT_MIN
||
to_base
==
INT_MIN
||
abs
(
to_base
)
>
36
||
abs
(
to_base
)
<
2
||
abs
(
from_base
)
>
36
||
abs
(
from_base
)
<
2
||
!
(
res
->
length
()))
{
...
...
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