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
93b15559
Commit
93b15559
authored
Dec 09, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: incorrect buffer sizes for net_store_length()
parent
e252af7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
sql/log_event.cc
sql/log_event.cc
+5
-5
sql/log_event_old.cc
sql/log_event_old.cc
+2
-2
No files found.
sql/log_event.cc
View file @
93b15559
...
...
@@ -9305,7 +9305,7 @@ int Rows_log_event::get_data_size()
{
int
const
general_type_code
=
get_general_type_code
();
uchar
buf
[
sizeof
(
m_width
)
+
1
];
uchar
buf
[
MAX_INT_WIDTH
];
uchar
*
end
=
net_store_length
(
buf
,
m_width
);
DBUG_EXECUTE_IF
(
"old_row_based_repl_4_byte_map_id_master"
,
...
...
@@ -9918,7 +9918,7 @@ bool Rows_log_event::write_data_body(IO_CACHE*file)
Note that this should be the number of *bits*, not the number of
bytes.
*/
uchar
sbuf
[
sizeof
(
m_width
)
+
1
];
uchar
sbuf
[
MAX_INT_WIDTH
];
my_ptrdiff_t
const
data_size
=
m_rows_cur
-
m_rows_buf
;
bool
res
=
false
;
uchar
*
const
sbuf_end
=
net_store_length
(
sbuf
,
(
size_t
)
m_width
);
...
...
@@ -10223,7 +10223,7 @@ Table_map_log_event::Table_map_log_event(THD *thd, TABLE *tbl, ulong tid,
m_null_bits
(
0
),
m_meta_memory
(
NULL
)
{
uchar
cbuf
[
sizeof
(
m_colcnt
)
+
1
];
uchar
cbuf
[
MAX_INT_WIDTH
];
uchar
*
cbuf_end
;
DBUG_ASSERT
(
m_table_id
!=
~
0UL
);
/*
...
...
@@ -10772,14 +10772,14 @@ bool Table_map_log_event::write_data_body(IO_CACHE *file)
uchar
const
dbuf
[]
=
{
(
uchar
)
m_dblen
};
uchar
const
tbuf
[]
=
{
(
uchar
)
m_tbllen
};
uchar
cbuf
[
sizeof
(
m_colcnt
)
+
1
];
uchar
cbuf
[
MAX_INT_WIDTH
];
uchar
*
const
cbuf_end
=
net_store_length
(
cbuf
,
(
size_t
)
m_colcnt
);
DBUG_ASSERT
(
static_cast
<
size_t
>
(
cbuf_end
-
cbuf
)
<=
sizeof
(
cbuf
));
/*
Store the size of the field metadata.
*/
uchar
mbuf
[
sizeof
(
m_field_metadata_size
)
];
uchar
mbuf
[
MAX_INT_WIDTH
];
uchar
*
const
mbuf_end
=
net_store_length
(
mbuf
,
m_field_metadata_size
);
return
(
wrapper_my_b_safe_write
(
file
,
dbuf
,
sizeof
(
dbuf
))
||
...
...
sql/log_event_old.cc
View file @
93b15559
...
...
@@ -1366,7 +1366,7 @@ Old_rows_log_event::~Old_rows_log_event()
int
Old_rows_log_event
::
get_data_size
()
{
uchar
buf
[
sizeof
(
m_width
)
+
1
];
uchar
buf
[
MAX_INT_WIDTH
];
uchar
*
end
=
net_store_length
(
buf
,
(
m_width
+
7
)
/
8
);
DBUG_EXECUTE_IF
(
"old_row_based_repl_4_byte_map_id_master"
,
...
...
@@ -1876,7 +1876,7 @@ bool Old_rows_log_event::write_data_body(IO_CACHE*file)
Note that this should be the number of *bits*, not the number of
bytes.
*/
uchar
sbuf
[
sizeof
(
m_width
)
];
uchar
sbuf
[
MAX_INT_WIDTH
];
my_ptrdiff_t
const
data_size
=
m_rows_cur
-
m_rows_buf
;
// This method should not be reached.
...
...
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