Commit 007732e
bpf/helpers: bpf_strnstr: Exact match length
strnstr should not treat the ending '\0' of s2 as a matching character,
otherwise the parameter 'len' will be meaningless, for example:
1. bpf_strnstr("openat", "open", 4) = -ENOENT
2. bpf_strnstr("openat", "open", 5) = 0
This patch makes (1) return 0, indicating a successful match.
Signed-off-by: Rong Tao <[email protected]>1 parent c9c941d commit 007732e
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3681 | 3681 | | |
3682 | 3682 | | |
3683 | 3683 | | |
| 3684 | + | |
| 3685 | + | |
3684 | 3686 | | |
3685 | 3687 | | |
3686 | 3688 | | |
| |||
0 commit comments