mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 19:23:03 +01:00
Restore checks for length. We don't need tokens bigger than 1KB.
This commit is contained in:
parent
0a379247c3
commit
5291dc6544
@ -404,15 +404,11 @@ static SSHORT get_next_token(
|
||||
token += *s++;
|
||||
}
|
||||
*stmt = s;
|
||||
/* CVC: Will adjust this check.
|
||||
if (p >= token_end) {
|
||||
if (token.length() > MAX_TOKEN_SIZE) {
|
||||
// '=' used as then there is no place for null termination
|
||||
|
||||
*token_length = MAX_TOKEN_SIZE;
|
||||
token[MAX_TOKEN_SIZE] = '\0';
|
||||
token.erase(MAX_TOKEN_SIZE);
|
||||
return TOKEN_TOO_LONG;
|
||||
}
|
||||
*/
|
||||
return STRING;
|
||||
}
|
||||
|
||||
@ -422,14 +418,10 @@ static SSHORT get_next_token(
|
||||
for (; s < stmt_end && (classes[c = *s] & CHR_DIGIT); ++s); // empty body
|
||||
const ptrdiff_t length = (s - start_of_token);
|
||||
*stmt = s;
|
||||
/* CVC: Will adjust this check.
|
||||
if (length > MAX_TOKEN_SIZE) {
|
||||
memcpy(token, start_of_token, MAX_TOKEN_SIZE);
|
||||
token[MAX_TOKEN_SIZE] = '\0';
|
||||
*token_length = MAX_TOKEN_SIZE;
|
||||
token.assign(start_of_token, MAX_TOKEN_SIZE);
|
||||
return TOKEN_TOO_LONG;
|
||||
}
|
||||
*/
|
||||
token.assign(start_of_token, length);
|
||||
return NUMERIC;
|
||||
}
|
||||
@ -443,13 +435,10 @@ static SSHORT get_next_token(
|
||||
}
|
||||
|
||||
*stmt = s;
|
||||
/* CVC: Will adjust this check.
|
||||
if (p >= token_end) {
|
||||
*token_length = MAX_TOKEN_SIZE;
|
||||
token[MAX_TOKEN_SIZE] = '\0';
|
||||
if (token.length() > MAX_TOKEN_SIZE) {
|
||||
token.erase(MAX_TOKEN_SIZE);
|
||||
return TOKEN_TOO_LONG;
|
||||
}
|
||||
*/
|
||||
return SYMBOL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user