diff mbox

isdn: use strlcpy() instead strcpy()

Message ID 20131216094626.GC13831@elgon.mountain
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Dan Carpenter Dec. 16, 2013, 9:46 a.m. UTC
I don't think the in-kernel drivers ever hit this strcpy() so this
doesn't change how the code works.  But strcpy() is safer.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Eric Dumazet Dec. 16, 2013, 1:43 p.m. UTC | #1
On Mon, 2013-12-16 at 12:46 +0300, Dan Carpenter wrote:
> I don't think the in-kernel drivers ever hit this strcpy() so this
> doesn't change how the code works.  But strcpy() is safer.
> 

strcpy() is safer ?

-ENOPARSE ...


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 18, 2013, 10:54 p.m. UTC | #2
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Mon, 16 Dec 2013 16:56:23 +0300

> I don't think the in-kernel drivers ever hit this strcpy() so this
> doesn't change how the code works.  But strlcpy() is safer.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied to net-next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/isdn/sc/event.c b/drivers/isdn/sc/event.c
index 717003a3bdf4..833d96c2cf92 100644
--- a/drivers/isdn/sc/event.c
+++ b/drivers/isdn/sc/event.c
@@ -57,7 +57,7 @@  int indicate_status(int card, int event, ulong Channel, char *Data)
 			memcpy(&cmd.parm.setup, Data, sizeof(cmd.parm.setup));
 			break;
 		default:
-			strcpy(cmd.parm.num, Data);
+			strlcpy(cmd.parm.num, Data, sizeof(cmd.parm.num));
 		}
 	}