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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
aacfd6dd
Commit
aacfd6dd
authored
Jul 28, 2009
by
Alexey Kopytov
Browse files
Options
Browse Files
Download
Plain Diff
Manual merge.
parents
a3045178
53434623
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
sql/net_serv.cc
sql/net_serv.cc
+11
-2
No files found.
sql/net_serv.cc
View file @
aacfd6dd
...
@@ -186,10 +186,12 @@ my_bool net_realloc(NET *net, size_t length)
...
@@ -186,10 +186,12 @@ my_bool net_realloc(NET *net, size_t length)
pkt_length
=
(
length
+
IO_SIZE
-
1
)
&
~
(
IO_SIZE
-
1
);
pkt_length
=
(
length
+
IO_SIZE
-
1
)
&
~
(
IO_SIZE
-
1
);
/*
/*
We must allocate some extra bytes for the end 0 and to be able to
We must allocate some extra bytes for the end 0 and to be able to
read big compressed blocks
read big compressed blocks + 1 safety byte since uint3korr() in
my_real_read() may actually read 4 bytes depending on build flags and
platform.
*/
*/
if
(
!
(
buff
=
(
uchar
*
)
my_realloc
((
char
*
)
net
->
buff
,
pkt_length
+
if
(
!
(
buff
=
(
uchar
*
)
my_realloc
((
char
*
)
net
->
buff
,
pkt_length
+
NET_HEADER_SIZE
+
COMP_HEADER_SIZE
,
NET_HEADER_SIZE
+
COMP_HEADER_SIZE
+
1
,
MYF
(
MY_WME
))))
MYF
(
MY_WME
))))
{
{
/* @todo: 1 and 2 codes are identical. */
/* @todo: 1 and 2 codes are identical. */
...
@@ -921,6 +923,13 @@ my_real_read(NET *net, size_t *complen)
...
@@ -921,6 +923,13 @@ my_real_read(NET *net, size_t *complen)
#ifdef HAVE_COMPRESS
#ifdef HAVE_COMPRESS
if
(
net
->
compress
)
if
(
net
->
compress
)
{
{
/*
The following uint3korr() may read 4 bytes, so make sure we don't
read unallocated or uninitialized memory. The right-hand expression
must match the size of the buffer allocated in net_realloc().
*/
DBUG_ASSERT
(
net
->
where_b
+
NET_HEADER_SIZE
+
sizeof
(
uint32
)
<=
net
->
max_packet
+
NET_HEADER_SIZE
+
COMP_HEADER_SIZE
+
1
);
/*
/*
If the packet is compressed then complen > 0 and contains the
If the packet is compressed then complen > 0 and contains the
number of bytes in the uncompressed packet
number of bytes in the uncompressed packet
...
...
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