On Wed, 2018-11-28 at 16:37 +0100, David Disseldorp wrote:
> On Tue, 20 Nov 2018 19:00:57 +0100, David Disseldorp wrote:
> 
> > > > +       strncpy(buf, page, sizeof(buf));    
> > > 
> > > Isn't strncpy() deprecated? How about using strlcpy() instead?  
> > 
> > Will change to use strlcpy in the next round.
> 
> Just a follow up here. I think it's safer to retain strncpy() in this
> function for the purpose of zero filling. scsi_dump_inquiry() and
> target_stat_lu_vend_show() walk the entire length of the t10_wwn.vendor
> buffer.

How about adding a comment about above struct t10_wwn that vendor[], model[]
and revision[] in that structure may but do not have to be terminated with a
trailing '\0' and also that unit_serial[] is '\0'-terminated?

It would make me happy if the size of the character arrays in that structure
would be increased by one and if the target code would be modified such that
these strings are always '\0'-terminated.

Thanks,

Bart.

Reply via email to