Re: [PATCH] staging: for dgrp, nd_ps_desc buffer length need be 'MAX_DESC_LEN + 1'

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

 



On Fri, Apr 26, 2013 at 05:34:45PM +0300, Dan Carpenter wrote:
> 
> I hate these "mostly NUL terminated" strings.  MAX_DESC_LEN
> is 100 characters so it's very rarely going to be filled all the
> way.  The special case where ->nd_ps_desc isn't terminated will
> never be tested.
> 

Yes, I think the original code picked the size of MAX_DESC_LEN
randomly.  The longest value I've seen for nd_ps_desc has been around
40.  

> 
> It seems likely to me that changing this struct is going to break
> things.  But maybe we could change the other side and say that the
> desc can be 99 characters and a NUL maximum.  Probably no one will
> notice a change like that.
> 

That seems like a great solution.  The one place where nd_ps_desc is
used now assumes it to work that way anyhow.

-- 
Bill
_______________________________________________
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