• Alexey Kopytov's avatar
    Bug #45031: invalid memory reads in my_real_read using protocol · baefaa1e
    Alexey Kopytov authored
                compression 
     
    Since uint3korr() may read 4 bytes depending on build flags and 
    platform, allocate 1 extra "safety" byte in the network buffer 
    for cases when uint3korr() in my_real_read() is called to read
    last 3 bytes in the buffer. 
     
    It is practically hard to construct a reliable and reasonably 
    small test case for this bug as that would require constructing 
    input stream such that a certain sequence of bytes in a 
    compressed packet happens to be the last 3 bytes of the network 
    buffer. 
    
    
    sql/net_serv.cc:
      Allocate 1 extra "safety" byte in the network buffer for cases 
      when uint3korr() is used to read last 3 bytes in the buffer.
    baefaa1e
net_serv.cc 31 KB