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
0b00c1a2
Commit
0b00c1a2
authored
Mar 23, 2020
by
Eugene Kosov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-22005 UBSAN: applying non-zero offset 2 to null pointer in my_charpos_mb()
Empty comment has a correct length.
parent
5918b170
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
sql/sql_string.h
sql/sql_string.h
+5
-1
sql/sql_table.cc
sql/sql_table.cc
+7
-3
No files found.
sql/sql_string.h
View file @
0b00c1a2
...
...
@@ -3,7 +3,7 @@
/*
Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2008, 20
17
, MariaDB Corporation.
Copyright (c) 2008, 20
20
, MariaDB Corporation.
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
...
...
@@ -79,6 +79,10 @@ class Well_formed_prefix: public Well_formed_prefix_status
Well_formed_prefix
(
CHARSET_INFO
*
cs
,
const
char
*
str
,
size_t
length
)
:
Well_formed_prefix_status
(
cs
,
str
,
str
+
length
,
length
),
m_str
(
str
)
{
}
Well_formed_prefix
(
CHARSET_INFO
*
cs
,
LEX_STRING
str
,
size_t
nchars
)
:
Well_formed_prefix_status
(
cs
,
str
.
str
,
str
.
str
+
str
.
length
,
nchars
),
m_str
(
str
.
str
)
{
}
size_t
length
()
const
{
return
m_source_end_pos
-
m_str
;
}
};
...
...
sql/sql_table.cc
View file @
0b00c1a2
/*
Copyright (c) 2000, 2019, Oracle and/or its affiliates.
Copyright (c) 2010, 20
19
, MariaDB
Copyright (c) 2010, 20
20
, MariaDB
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
...
...
@@ -4286,8 +4286,12 @@ bool validate_comment_length(THD *thd, LEX_STRING *comment, size_t max_len,
uint
err_code
,
const
char
*
name
)
{
DBUG_ENTER
(
"validate_comment_length"
);
uint
tmp_len
=
my_charpos
(
system_charset_info
,
comment
->
str
,
comment
->
str
+
comment
->
length
,
max_len
);
if
(
comment
->
length
==
0
)
DBUG_RETURN
(
false
);
size_t
tmp_len
=
Well_formed_prefix
(
system_charset_info
,
*
comment
,
max_len
).
length
();
if
(
tmp_len
<
comment
->
length
)
{
if
(
thd
->
is_strict_mode
())
...
...
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