Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c1dfa1f authored by Manu Gautam's avatar Manu Gautam Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: configfs: Replace strncpy with strlcpy



Use safer version of strcpy that is strlcpy instead of
strncpy for NULL terminated strings.

Change-Id: I5e2800d1d539545744a1b1231e1d589a7c92797a
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent 80fded8c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ static int usb_string_copy(const char *s, char **s_copy)
		if (!str)
			return -ENOMEM;
	}
	strncpy(str, s, MAX_USB_STRING_WITH_NULL_LEN);
	strlcpy(str, s, MAX_USB_STRING_WITH_NULL_LEN);
	if (str[ret - 1] == '\n')
		str[ret - 1] = '\0';
	*s_copy = str;