lkml.org 
[lkml]   [2003]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Resend [PATCH] Make KOBJ_NAME_LEN match BUS_ID_SIZE
From
Date
On Sun, 25 May 2003 10:51:02 CDT, Matt Mackall said:

> The return value here isn't particularly useful. The OpenBSD
> strlcpy/strlcat variant tell you how big the result should have been
> so that you can realloc if need be.

A quick grep of the current source tree seems to indicate that there aren't
any uses of 'strncpy' that actually save or check the return value.

As such, actually *using* the return value would make for a job for the
kernel janitors, to actually do something useful at all 650 or so uses.

Given that the kernel probably *shouldn't* be trying to strlcpy() into
a destination that it won't fit, it may be more useful to do a BUG_ON()
or similar (feel free to use a 'goto too_long;' if you prefer ;)

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.085 / U:0.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site