mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-17 08:11:32 +00:00
fix(userspace/engine): absolute rule condition position in validation context
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
parent
d79d7112a0
commit
c1985a7c99
@ -92,9 +92,10 @@ rule_loader::context::context(const libsinsp::filter::ast::pos_info& pos,
|
|||||||
// parser line/columns are 1-indexed while yaml marks are
|
// parser line/columns are 1-indexed while yaml marks are
|
||||||
// 0-indexed, though.
|
// 0-indexed, though.
|
||||||
position condpos;
|
position condpos;
|
||||||
condpos.pos = pos.idx;
|
auto& lastpos = parent.m_locs.back();
|
||||||
condpos.line = pos.line-1;
|
condpos.pos = pos.idx + lastpos.pos.pos;
|
||||||
condpos.column = pos.col-1;
|
condpos.line = pos.line + lastpos.pos.line;
|
||||||
|
condpos.column = pos.col + lastpos.pos.column;
|
||||||
|
|
||||||
init(name, condpos, rule_loader::context::CONDITION_EXPRESSION, item_name, parent);
|
init(name, condpos, rule_loader::context::CONDITION_EXPRESSION, item_name, parent);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user