diff --git a/src/dsql/parse.y b/src/dsql/parse.y index b758947bf8..8fcc2a86be 100644 --- a/src/dsql/parse.y +++ b/src/dsql/parse.y @@ -5439,9 +5439,8 @@ int Parser::yylexAux() continue; } - if ((c == '-') && (*lex.ptr == '-')) + if ((c == '-') && (lex.ptr < lex.end) && (*lex.ptr == '-')) { - /* single-line */ lex.ptr++; @@ -5456,9 +5455,8 @@ int Parser::yylexAux() return -1; continue; } - else if ((c == '/') && (*lex.ptr == '*')) + else if ((c == '/') && (lex.ptr < lex.end) && (*lex.ptr == '*')) { - /* multi-line */ const TEXT& start_block = lex.ptr[-1]; @@ -5639,7 +5637,7 @@ int Parser::yylexAux() // The resulting value is stored in a string descriptor and // returned to the parser as a string. This can be stored // in a character or binary item. - if ((c == 'x' || c == 'X') && *lex.ptr == '\'') + if ((c == 'x' || c == 'X') && (lex.ptr < lex.end) && *lex.ptr == '\'') { bool hexerror = false; @@ -5743,7 +5741,7 @@ int Parser::yylexAux() // to an integer, and the result returned to the caller. The // token is identified as a NUMBER if it's a 32-bit or less // value, or a NUMBER64INT if it requires a 64-bit number. - if ((c == '0') && (*lex.ptr == 'x' || *lex.ptr == 'X') && + if ((c == '0') && (lex.ptr < lex.end) && (*lex.ptr == 'x' || *lex.ptr == 'X') && (classes(lex.ptr[1]) & CHR_HEX)) { bool hexerror = false;