|
1 |
| -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. |
| 1 | +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. |
2 | 2 |
|
3 | 3 | This program is free software; you can redistribute it and/or modify
|
4 | 4 | it under the terms of the GNU General Public License as published by
|
@@ -179,12 +179,10 @@ my_bool net_realloc(NET *net, size_t length)
|
179 | 179 | pkt_length = (length+IO_SIZE-1) & ~(IO_SIZE-1);
|
180 | 180 | /*
|
181 | 181 | We must allocate some extra bytes for the end 0 and to be able to
|
182 |
| - read big compressed blocks + 1 safety byte since uint3korr() in |
183 |
| - my_real_read() may actually read 4 bytes depending on build flags and |
184 |
| - platform. |
| 182 | + read big compressed blocks in my_real_read(). |
185 | 183 | */
|
186 | 184 | if (!(buff= (uchar*) my_realloc((char*) net->buff, pkt_length +
|
187 |
| - NET_HEADER_SIZE + COMP_HEADER_SIZE + 1, |
| 185 | + NET_HEADER_SIZE + COMP_HEADER_SIZE, |
188 | 186 | MYF(MY_WME))))
|
189 | 187 | {
|
190 | 188 | /* @todo: 1 and 2 codes are identical. */
|
@@ -951,12 +949,11 @@ my_real_read(NET *net, size_t *complen)
|
951 | 949 | if (net->compress)
|
952 | 950 | {
|
953 | 951 | /*
|
954 |
| - The following uint3korr() may read 4 bytes, so make sure we don't |
955 |
| - read unallocated or uninitialized memory. The right-hand expression |
956 |
| - must match the size of the buffer allocated in net_realloc(). |
| 952 | + The right-hand expression must match the size of the buffer |
| 953 | + allocated in net_realloc(). |
957 | 954 | */
|
958 | 955 | DBUG_ASSERT(net->where_b + NET_HEADER_SIZE + sizeof(uint32) <=
|
959 |
| - net->max_packet + NET_HEADER_SIZE + COMP_HEADER_SIZE + 1); |
| 956 | + net->max_packet + NET_HEADER_SIZE + COMP_HEADER_SIZE); |
960 | 957 | /*
|
961 | 958 | If the packet is compressed then complen > 0 and contains the
|
962 | 959 | number of bytes in the uncompressed packet
|
|
0 commit comments