Commit b80358f
evt_apply: fix off-by-one bounds check in data event region lookup
The region stack bounds check in apply__data_generic() used a strict
less-than comparison (`len(regionStack) < rWant`) which allowed
an out-of-bounds access when rWant exactly equalled the stack length.
For example, a data event with nesting=2 and an empty region stack
would compute rWant=0, pass the `0 < 0` check, then panic on
`regionStack[0]`.
In a real service, this meant that data events nested inside
regions that weren't tracked (common with gvfs-helper errors) would
crash the receiver rather than being silently skipped. This also
prevented the string_patterns summary promotion from working
end-to-end, since the crash occurred after the promotion call.
Fix the check to use `<=` and also guard against negative rWant.
Add an end-to-end test that feeds the exact trace.json event
through parse and apply to verify the full path works.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 40badea commit b80358f
2 files changed
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
852 | 852 | | |
853 | 853 | | |
854 | 854 | | |
855 | | - | |
| 855 | + | |
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
878 | 878 | | |
879 | 879 | | |
880 | 880 | | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
0 commit comments