mirror of
https://github.com/typesense/typesense.git
synced 2025-05-22 06:40:30 +08:00
Limit token size to handle bad data.
This commit is contained in:
parent
79ddbd56de
commit
15d3da7203
@ -1146,6 +1146,10 @@ void Index::tokenize_string_with_facets(const std::string& text, bool is_facet,
|
||||
continue;
|
||||
}
|
||||
|
||||
if(token.size() > 100) {
|
||||
token.erase(100);
|
||||
}
|
||||
|
||||
token_to_offsets[token].push_back(token_index + 1);
|
||||
last_token = token;
|
||||
|
||||
@ -1191,6 +1195,10 @@ void Index::tokenize_string_array_with_facets(const std::vector<std::string>& st
|
||||
continue;
|
||||
}
|
||||
|
||||
if(token.size() > 100) {
|
||||
token.erase(100);
|
||||
}
|
||||
|
||||
token_to_offsets[token].push_back(token_index + 1);
|
||||
token_set.insert(token);
|
||||
last_token = token;
|
||||
|
Loading…
x
Reference in New Issue
Block a user