Fix digest comment removal for queries over 'query_digests_max_query_length'

Due to a typo/confusion, the boundary being used for comments check was
'd_max_len' instead of 'q_len'. This prevented the correct detection of
a comment start when the query exceeded 'query_digests_max_query_length'
which determines the value for 'd_max_len'.
pull/4932/head
Javier Jaramago Fernández 11 months ago
parent 1c416275ee
commit 5c3a063775

@ -447,7 +447,8 @@ enum p_st get_next_st(const options* opts, struct shared_st* shared_st) {
// cmnt type 1 - start with '/*'
if(
// v1_crashing_payload_05
shared_st->q_cur_pos < (shared_st->d_max_len-1) && *shared_st->q == '/' && *(shared_st->q+1) == '*'
shared_st->q_cur_pos < (shared_st->q_len - 2) &&
*shared_st->q == '/' && *(shared_st->q+1) == '*'
) {
st = st_cmnt_type_1;
}
@ -458,7 +459,7 @@ enum p_st get_next_st(const options* opts, struct shared_st* shared_st) {
// cmnt type 3 - start with '--'
else if (
// shared_st->query isn't over, need to check next character
shared_st->q_cur_pos < (shared_st->d_max_len-2) &&
shared_st->q_cur_pos < (shared_st->q_len - 2) &&
// found starting pattern '-- ' (space is required)
*shared_st->q == '-' && *(shared_st->q+1) == '-' && is_space_char(*(shared_st->q+2))
) {

Loading…
Cancel
Save