ChangeSet 1.2181.41.5, 2005/03/30 16:35:41-08:00, [EMAIL PROTECTED]

        [AF_UNIX]: unix_mkname comment
        
        Resurrect an old comment, explaining why this isn't an off-by-one error.
        
        Signed-off-by: Hideaki YOSHIFUJI <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: David S. Miller <[EMAIL PROTECTED]>



 af_unix.c |    7 +++++++
 1 files changed, 7 insertions(+)


diff -Nru a/net/unix/af_unix.c b/net/unix/af_unix.c
--- a/net/unix/af_unix.c        2005-03-30 20:07:17 -08:00
+++ b/net/unix/af_unix.c        2005-03-30 20:07:17 -08:00
@@ -188,6 +188,13 @@
        if (!sunaddr || sunaddr->sun_family != AF_UNIX)
                return -EINVAL;
        if (sunaddr->sun_path[0]) {
+               /*
+                * This may look like an off by one error but it is a bit more
+                * subtle. 108 is the longest valid AF_UNIX path for a binding.
+                * sun_path[108] doesnt as such exist.  However in kernel space
+                * we are guaranteed that it is a valid memory location in our
+                * kernel address buffer.
+                */
                ((char *)sunaddr)[len]=0;
                len = strlen(sunaddr->sun_path)+1+sizeof(short);
                return len;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to