[PATCH] use util_strscpy() in util_delete_path(), too

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I noticed that util_create_path() used util_strscpy() while
util_delete_path() used strcpy() for basically the same purpose.
I haven't checked in much depth whether there actually was intention
behind this, but it didn't seem so, so here is a patch.
Untested, as usual.

Florian

diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c
index 15fac7c..557df1b 100644
--- a/libudev/libudev-util-private.c
+++ b/libudev/libudev-util-private.c
@@ -69,7 +69,7 @@ int util_delete_path(struct udev *udev, const char *path)
 	char *pos;
 	int retval;
 
-	strcpy (p, path);
+	util_strscpy(p, sizeof(p), path);
 	pos = strrchr(p, '/');
 	if (pos == p || pos == NULL)
 		return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux