From mboxrd@z Thu Jan 1 00:00:00 1970 From: land.ho87@gmail.com (land.ho87 at gmail.com) Date: Wed, 3 Dec 2014 03:13:28 +1100 Subject: Possible error in debugfs/file.c Message-ID: <20141202161328.GA15584@arch> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org I'm just reading the kernel source and came across this which doesn't look quite right to me: 616 size_t size = strlen(file->private_data); strlen is used here when the pointer points to type: 567 struct array_data { 568 void *array; 569 u32 elements; 570 }; I think line 616 should probably be something like: size_t size = file->private_data.elements*sizeof(u32); I think strlen would terminate incorrectly on any null byte, and is unnecessary since the data is already counted. Is this a legitimate criticism?