diff options
author | Rafal Somla <rafal.somla@oracle.com> | 2011-09-29 17:02:16 +0200 |
---|---|---|
committer | Rafal Somla <rafal.somla@oracle.com> | 2011-09-29 17:02:16 +0200 |
commit | f03a55cc5be888b4f387af41384906cfdac1fb45 (patch) | |
tree | 5cd6702fdce40d68c95ffb20e1a0a377a873d13d /libmysql | |
parent | 4db6d87789a6bdb96ce8fbbc9d292505c7cd725d (diff) | |
download | mariadb-git-f03a55cc5be888b4f387af41384906cfdac1fb45.tar.gz |
Bug#12982926 CLIENT CAN OVERRIDE ZERO-LENGTH-ALLOCATE BUFFER
Changes in client plugin needed for testing the issue (test instrumentation).
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/authentication_win/handshake_client.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libmysql/authentication_win/handshake_client.cc b/libmysql/authentication_win/handshake_client.cc index 565726651cb..02e5483da29 100644 --- a/libmysql/authentication_win/handshake_client.cc +++ b/libmysql/authentication_win/handshake_client.cc @@ -161,6 +161,21 @@ int Handshake_client::write_packet(Blob &data) keep all the data. */ unsigned block_count= data.len()/512 + ((data.len() % 512) ? 1 : 0); + +#if !defined(DBUG_OFF) && defined(WINAUTH_USE_DBUG_LIB) + + /* + For testing purposes, use wrong block count to see how server + handles this. + */ + DBUG_EXECUTE_IF("winauth_first_packet_test",{ + block_count= data.len() == 601 ? 0 : + data.len() == 602 ? 1 : + block_count; + }); + +#endif + DBUG_ASSERT(block_count < (unsigned)0x100); saved_byte= data[254]; data[254] = block_count; |