Comment 15 for bug 705688

Revision history for this message
Vlad Lesin (vlad-lesin) wrote :

Laurynas, the fix for the issue was merged to 5.1 in revision number 443. The differences between Alexey's fix and fix in 443 revision are not so big and described and backported here lp:~vlad-lesin/percona-server/5.1-bug915814 .

The main issue of wrong buffer size calculating and allocating was solved in revision 443. The following change in "void QueryStripComments::set(const char* query, uint query_length, uint additional_length)" could help to avoid crashes in 5.1 tied with query_cache_strip_comments option:

@@ -466,7 +466,7 @@
         buffer[position++] = ' ';
       }
     }
- else
+ else if (query_position < query_length)
     {
       buffer[position++] = query[query_position++];
     }

Otherwise we faced with another bug.