Re: [PATCH v3] perf tools: Fix build-id matching on vmlinux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ingo,

On Mon, 22 Sep 2014 07:16:30 +0200, Ingo Molnar wrote:
> * Namhyung Kim <namhyung@xxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]