isdn: icn: use strlcpy() when parsing setup options
authorDan Carpenter <dan.carpenter@oracle.com>
Sun, 15 Mar 2015 10:48:03 +0000 (13:48 +0300)
committerJiri Slaby <jslaby@suse.cz>
Wed, 10 Jun 2015 11:42:17 +0000 (13:42 +0200)
commit 10640d34552ccd8fabe7b15b0c4e3a102247952d upstream.

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 <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/isdn/icn/icn.c

index e74df7c4658f1b987acf6dec2b855419fb9a174a..af1577dd982515f83c6aa2ad0ee83d4ea5a07802 100644 (file)
@@ -1611,7 +1611,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;