isdn: icn: use strlcpy() when parsing setup options
Subsystems (3)
PATCH 1/1 isdn: icn: use strlcpy() when parsing setup options
If you pass an invalid string here then you probably deserve the memory corruption, but it annoys static analysis tools so lets fix it.
Signed-off-by Dan Carpenter <[email protected]>
drivers/isdn/icn/icn.c +1 -1
@@ -1609,7 +1609,7 @@ icn_setup(char *line)if (ints[0 ] >1 ) membase = (unsigned long )ints[2 ];if (str && *str) { -strcpy (sid, str); +strlcpy (sid, str,sizeof (sid)); icn_id = sid;if ((p =strchr (sid,',' ))) { *p++ =0 ;
From: Dan Carpenter <[email protected]>
Date: Sun, 15 Mar 2015 13:48:03 +0300
Quoted 4 lines
If you pass an invalid string here then you probably deserve the memory corruption, but it annoys static analysis tools so lets fix it.
Signed-off-by Dan Carpenter <[email protected]>
Applied, thanks Dan.