Fix OOB in Query::new
This commit is contained in:
parent
67f4f2328c
commit
f461d953a6
1 changed files with 1 additions and 1 deletions
|
|
@ -1401,7 +1401,7 @@ impl Query {
|
|||
let suffix = source.split_at(offset).1;
|
||||
let end_offset = suffix
|
||||
.find(|c| !char::is_alphanumeric(c) && c != '_' && c != '-')
|
||||
.unwrap_or(source.len());
|
||||
.unwrap_or(suffix.len());
|
||||
message = suffix.split_at(end_offset).0.to_string();
|
||||
kind = match error_type {
|
||||
ffi::TSQueryError_TSQueryErrorNodeType => QueryErrorKind::NodeType,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue