lkml.org 
[lkml]   [2014]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3] perf tools: Fix build-id matching on vmlinux
Date
Hi Ingo,

On Mon, 22 Sep 2014 07:16:30 +0200, Ingo Molnar wrote:
> * Namhyung Kim <namhyung@kernel.org> wrote:
>> + list_for_each_entry(dso, &machine->kernel_dsos, node) {
>> + const char *suffix;
>> +
>> + suffix = dso->long_name + strlen(dso->long_name) - 3;
>> + if (strcmp(suffix, ".ko")) {
>> + kernel = dso;
>> + break;
>> + }
>
> Is strlen(dso->long_name) guaranteed to be >= 3? If not then you
> should probably check for it, otherwise we might strcmp into
> invalid memory.

I *think* they are all valid kernel modules so length should be greater
than 3. But I also think that adding such an extra check won't cause
any harm. So I'll change to check it in v4. :)

Thanks for your review!
Namhyung


\
 
 \ /
  Last update: 2014-09-22 10:01    [W:0.048 / U:1.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site