lkml.org 
[lkml]   [2009]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] ftrace: Fix MATCH_END_ONLY filter matching
>>>>> 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.
>>>
>>> Oh you're right, I reviewed it too quickly. Perhaps the star's
>>> alignment made it possible for only one Frederic to review it
>>> the right way...
>>>
>> The stars are still fuzzy to me. How does memcpy work here?
>
>
> It doesn't, I guess Li intended to use memcmp.
>

Oops, I forgot to fix this before sending the patch out.. :(



\
 
 \ /
  Last update: 2009-12-14 02:07    [W:0.057 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site