Skip to contentSkip to conversation

isdn: use strlcpy() instead strcpy()

PATCH Applied Dan Carpenter 3 participants 3 messages Dec 16, 2013 – Dec 18, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 isdn: use strlcpy() instead strcpy()

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.

drivers/isdn/sc/event.c +1 -1
index 717003a3bdf4..833d96c2cf92 100644
@@ -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));
 		}
 	}
 
#1 lore raw
Quoted 3 lines · Dan Carpenter

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 ...