Skip to content

Commit f03a55c

Browse files
committed
Bug#12982926 CLIENT CAN OVERRIDE ZERO-LENGTH-ALLOCATE BUFFER
Changes in client plugin needed for testing the issue (test instrumentation).
1 parent 4db6d87 commit f03a55c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

libmysql/authentication_win/handshake_client.cc

+15
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,21 @@ int Handshake_client::write_packet(Blob &data)
161161
keep all the data.
162162
*/
163163
unsigned block_count= data.len()/512 + ((data.len() % 512) ? 1 : 0);
164+
165+
#if !defined(DBUG_OFF) && defined(WINAUTH_USE_DBUG_LIB)
166+
167+
/*
168+
For testing purposes, use wrong block count to see how server
169+
handles this.
170+
*/
171+
DBUG_EXECUTE_IF("winauth_first_packet_test",{
172+
block_count= data.len() == 601 ? 0 :
173+
data.len() == 602 ? 1 :
174+
block_count;
175+
});
176+
177+
#endif
178+
164179
DBUG_ASSERT(block_count < (unsigned)0x100);
165180
saved_byte= data[254];
166181
data[254] = block_count;

0 commit comments

Comments
 (0)