[IRDA]: out of range array access
authorDavid Binderman <dcb314@hotmail.com>
Fri, 10 Feb 2006 00:59:48 +0000 (16:59 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Feb 2006 00:59:48 +0000 (16:59 -0800)
This patch fixes an out of range array access in irnet_irda.c.

Author: David Binderman <dcb314@hotmail.com>
Signed-off-by: Samuel Ortiz <samuel.ortiz@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/irda/irnet/irnet_irda.c

index 07ec326c71f5b28b4eb6540d858823a6eff07fe8..f65c7a83bc5cf95d3f5884ec9391a888b59e590f 100644 (file)
@@ -696,7 +696,7 @@ irnet_daddr_to_dname(irnet_socket * self)
        {
          /* Yes !!! Get it.. */
          strlcpy(self->rname, discoveries[i].info, sizeof(self->rname));
-         self->rname[NICKNAME_MAX_LEN + 1] = '\0';
+         self->rname[sizeof(self->rname) - 1] = '\0';
          DEBUG(IRDA_SERV_INFO, "Device 0x%08x is in fact ``%s''.\n",
                self->daddr, self->rname);
          kfree(discoveries);