Skip to contentSkip to conversation

udev buffer overrun fix

PATCH New Michael Buesch 1 participant 1 message Feb 24, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udev buffer overrun fix

Hi,

This patch fixes a possible buffer overrun for char filename[255] in create_node().

udev-add.c 2004-02-24 20:49:25.000000000 +0100 renamed from udev-add.c.orig 2004-02-24 15:24:13.000000000 +0100 +1 -1
@@ -146,7 +146,7 @@
        int tail;
 
        strncpy(filename, udev_root, sizeof(filename));
-       strncat(filename, dev->name, sizeof(filename));
+       strncat(filename, dev->name, sizeof(filename) - strlen(udev_root) - 1);
 
        switch (dev->type) {
        case 'b':
Signature · 13 lines
Regards Michael Buesch  [ http://www.tuxsoft.de.vu ]



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel