Commit c110a8b7 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'trace-v4.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fix from Steven Rostedt:
 "Working on some new updates to trace filtering, I noticed that the
  regex_match_front() test was updated to be limited to the size of the
  pattern instead of the full test string.

  But as the test string is not guaranteed to be nul terminated, it
  still needs to consider the size of the test string"

* tag 'trace-v4.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Fix regex_match_front() to not over compare the test string
parents 84c3a097 dc432c3d
...@@ -762,6 +762,9 @@ static int regex_match_full(char *str, struct regex *r, int len) ...@@ -762,6 +762,9 @@ static int regex_match_full(char *str, struct regex *r, int len)
static int regex_match_front(char *str, struct regex *r, int len) static int regex_match_front(char *str, struct regex *r, int len)
{ {
if (len < r->len)
return 0;
if (strncmp(str, r->pattern, r->len) == 0) if (strncmp(str, r->pattern, r->len) == 0)
return 1; return 1;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment