chiark / gitweb /
[PATCH] uninitialized variable for mknod and friend
authorolh@suse.de <olh@suse.de>
Wed, 24 Mar 2004 02:52:52 +0000 (18:52 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:35:10 +0000 (21:35 -0700)
mknod gets an uninitialized variable, which leads to interesting file
modes. the bug is in namedev, devices with no match must not use the
uninitialized stuff were dev points to.

namedev.c

index e075e20af57dd189efaae8f6a823f8b1104fc012..6606ce8f79a2fdaa56d76cccb87d1ca092646e28 100644 (file)
--- a/namedev.c
+++ b/namedev.c
@@ -843,12 +843,12 @@ found:
        strfieldcpy(udev->config_file, dev->config_file);
        udev->config_line = dev->config_line;
 
-done:
        /* get permissions given in rule */
        set_empty_perms(udev, dev->mode,
                              dev->owner,
                              dev->group);
 
+done:
        /* get permissions given in config file or set defaults */
        perm = find_perm(udev->name);
        if (perm != NULL) {