Re: Resend [PATCH] Make KOBJ_NAME_LEN match BUS_ID_SIZE

Valdis.Kletnieks@vt.edu
Sun, 25 May 2003 14:13:02 -0400


--==_Exmh_-1416243708P
Content-Type: text/plain; charset=us-ascii

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 ;)

--==_Exmh_-1416243708P
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Exmh version 2.5 07/13/2001

iD8DBQE+0QetcC3lWbTT17ARAs/fAKDs+fSKAMAZaoNuciSMmg+N276WjgCdHLgA
43iny6oXZ8hVpg+BBbJ9oUQ=
=+4au
-----END PGP SIGNATURE-----

--==_Exmh_-1416243708P--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/