Re: [PATCH 1/6] pstore: Add console log messages support

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

 



On Wed, May 16, 2012 at 09:49:11AM -0700, Kees Cook wrote:
[...]
> > +#ifdef CONFIG_PSTORE_CONSOLE
> > +static void pstore_console_write(struct console *con, const char *s, unsigned c)
> > +{
> > +       strncpy(psinfo->buf, s, c);
> 
> The size of psinfo->buf needs to be the length argument to strncpy,
> not the size of "s". If "s" isn't NULL terminated, then the min of c
> and buf's size should be used. And if this should be NULL terminated
> in buf, that needs to be added manually since strncpy won't do it if
> it hits the max length argument.

Whoops. Will fix it, thanks!

-- 
Anton Vorontsov
Email: cbouatmailru@xxxxxxxxx
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux