Re: [PATCH] modpost: fix segfault with short symbol names

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

 



On Sat, Dec 12, 2009 at 04:26:20PM +0100, Segher Boessenkool wrote:
> >memcmp() is wrong here, the symbol name can be shorter than
> >KSYMTAB_PFX
> >or CRC_PFX.
> 
> >-		if (memcmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
> >+		if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
> 
> This doesn't change anything.  In both cases the function will return 0
> only if all strlen(CRC_PFX) chars match, and in both cases it can access
> strlen(CRC_PFX) chars (strncmp() is allowed to access characters after
> the first \0 just fine).

str(n)cmp is not allowed to access characters past the NUL byte.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux