Hi Luís,
Thanks for this work, patch approved!
/Sven
Luis Soares wrote:
> #At file:///home/lsoares/Workspace/bzr/work/bugfixing/56883/mysql-next-mr-bugfixing/
> based on revid:mats.kindahl@stripped
>
> 3298 Luis Soares 2010-09-24
> BUG#56883: rpl_row_ignorable_event fails on valgrind run
>
> The buffer used in mysql_client_binlog_statement is never
> initialized and may contain several events data in it. If an
> event is processed and its payload is handled as a null
> terminated string, then conditional jumps depending on
> uninitialized values may ocur. Such cases happen if there is
> access outside this event portion of the buffer used for
> storing its data. This was the case for Rows_query_log_event.
>
> We fix this by replacing my_snprintf with strmake (which copies
> only the specified len bytes from str and sets
> *(my_rows_query+len)= '\0'.
>
> modified:
> sql/log_event.cc
> === modified file 'sql/log_event.cc'
> --- a/sql/log_event.cc 2010-09-01 02:51:08 +0000
> +++ b/sql/log_event.cc 2010-09-24 15:24:54 +0000
> @@ -9864,7 +9864,7 @@ Rows_query_log_event::Rows_query_log_eve
> read_str(&ptr, str_end, &str, &len);
> if (!(m_rows_query= (char*) my_malloc(len+1, MYF(MY_WME))))
> return;
> - my_snprintf(m_rows_query, len+1, "%s", str);
> + strmake(m_rows_query, str, len);
> DBUG_PRINT("info", ("m_rows_query: %s", m_rows_query));
> DBUG_VOID_RETURN;
> }
>
>
>
> ------------------------------------------------------------------------
>
>