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
f4eac2de
Commit
f4eac2de
authored
Jul 31, 2018
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-16054 simple json functions flatline cpu on garbage input.
Incorrect char sentence should be handled properly.
parent
fd378fc6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
mysql-test/r/func_json.result
mysql-test/r/func_json.result
+6
-0
mysql-test/t/func_json.test
mysql-test/t/func_json.test
+7
-0
strings/json_lib.c
strings/json_lib.c
+2
-0
No files found.
mysql-test/r/func_json.result
View file @
f4eac2de
...
...
@@ -760,3 +760,9 @@ t1 CREATE TABLE `t1` (
`c2` varchar(38) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# MDEV-16054 simple json functions flatline cpu on garbage input.
#
select json_array(1,uuid(),compress(5.140264e+307));
json_array(1,uuid(),compress(5.140264e+307))
NULL
mysql-test/t/func_json.test
View file @
f4eac2de
...
...
@@ -422,3 +422,10 @@ CREATE TABLE t1 AS SELECT
JSON_QUOTE
(
_utf8
'foo'
)
AS
c2
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-16054 simple json functions flatline cpu on garbage input.
--
echo
#
select
json_array
(
1
,
uuid
(),
compress
(
5.140264e+307
));
strings/json_lib.c
View file @
f4eac2de
...
...
@@ -1645,6 +1645,8 @@ int json_escape(CHARSET_INFO *str_cs,
return
-
1
;
}
}
else
/* c_len == 0, an illegal symbol. */
return
-
1
;
}
return
(
int
)(
json
-
json_start
);
...
...
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