lkml.org 
[lkml]   [2009]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/4] ftrace: Fix MATCH_END_ONLY filter matching
2009/12/11 Li Zefan <lizf@cn.fujitsu.com>:
> For '*foo' pattern, we should allow any string ending with
> 'foo', but ftrace filter incorrectly disallows strings
> like bar_foo_foo:
[...]
>        case MATCH_END_ONLY:
> -               ptr = strstr(str, regex);
> -               if (ptr && (ptr[len] == 0))
> +               slen = strlen(str);
> +               if (slen >= len && memcpy(str + slen - len, regex, len))
>                        matched = 1;

Shouldn't that be memcmp() == 0? I don't see how memcpy might serve as
a compare operator.

Fred.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-12-11 13:23    [W:0.090 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site