diff --git a/lib/c_tokenizer.cpp b/lib/c_tokenizer.cpp index 01d109b56..5281be3dc 100644 --- a/lib/c_tokenizer.cpp +++ b/lib/c_tokenizer.cpp @@ -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)) ) {