commit-hurd
[Top][All Lists]
Advanced

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

[hurd] 21/26: Fix insecure format


From: Samuel Thibault
Subject: [hurd] 21/26: Fix insecure format
Date: Tue, 22 Sep 2015 21:51:49 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch dde
in repository hurd.

commit 63dc5656c46f3ff1223e25325e92358822a65b76
Author: Samuel Thibault <address@hidden>
Date:   Mon Aug 31 00:59:12 2015 +0200

    Fix insecure format
    
    * contrib/drivers/base/attribute_container.c
    (attribute_container_add_device): Use %s format instead of a given char*.
    * contrib/drivers/base/platform.c (platform_device_add): Likewise.
    * contrib/drivers/base/sys.c (sysdev_class_register): Likewise.
    * contrib/lib/kobject.c (kset_create): Likewise.
    * contrib/net/core/net-sysfs.c (netdev_register_kobject): Likewise.
    * lib/src/drivers/base/core.c (__root_device_register): Likewise.
---
 libdde_linux26/contrib/drivers/base/attribute_container.c | 2 +-
 libdde_linux26/contrib/drivers/base/platform.c            | 2 +-
 libdde_linux26/contrib/drivers/base/sys.c                 | 2 +-
 libdde_linux26/contrib/lib/kobject.c                      | 2 +-
 libdde_linux26/contrib/net/core/net-sysfs.c               | 2 +-
 libdde_linux26/lib/src/drivers/base/core.c                | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libdde_linux26/contrib/drivers/base/attribute_container.c 
b/libdde_linux26/contrib/drivers/base/attribute_container.c
index b9cda05..e0f7859 100644
--- a/libdde_linux26/contrib/drivers/base/attribute_container.c
+++ b/libdde_linux26/contrib/drivers/base/attribute_container.c
@@ -167,7 +167,7 @@ attribute_container_add_device(struct device *dev,
                ic->classdev.parent = get_device(dev);
                ic->classdev.class = cont->class;
                cont->class->dev_release = attribute_container_release;
-               dev_set_name(&ic->classdev, dev_name(dev));
+               dev_set_name(&ic->classdev, "%s", dev_name(dev));
                if (fn)
                        fn(cont, dev, &ic->classdev);
                else
diff --git a/libdde_linux26/contrib/drivers/base/platform.c 
b/libdde_linux26/contrib/drivers/base/platform.c
index 349a101..030d638 100644
--- a/libdde_linux26/contrib/drivers/base/platform.c
+++ b/libdde_linux26/contrib/drivers/base/platform.c
@@ -244,7 +244,7 @@ int platform_device_add(struct platform_device *pdev)
        if (pdev->id != -1)
                dev_set_name(&pdev->dev, "%s.%d", pdev->name,  pdev->id);
        else
-               dev_set_name(&pdev->dev, pdev->name);
+               dev_set_name(&pdev->dev, "%s", pdev->name);
 
        for (i = 0; i < pdev->num_resources; i++) {
                struct resource *p, *r = &pdev->resource[i];
diff --git a/libdde_linux26/contrib/drivers/base/sys.c 
b/libdde_linux26/contrib/drivers/base/sys.c
index b428c8c..38e725c 100644
--- a/libdde_linux26/contrib/drivers/base/sys.c
+++ b/libdde_linux26/contrib/drivers/base/sys.c
@@ -137,7 +137,7 @@ int sysdev_class_register(struct sysdev_class * cls)
        cls->kset.kobj.parent = &system_kset->kobj;
        cls->kset.kobj.ktype = &ktype_sysdev_class;
        cls->kset.kobj.kset = system_kset;
-       kobject_set_name(&cls->kset.kobj, cls->name);
+       kobject_set_name(&cls->kset.kobj, "%s", cls->name);
        return kset_register(&cls->kset);
 }
 
diff --git a/libdde_linux26/contrib/lib/kobject.c 
b/libdde_linux26/contrib/lib/kobject.c
index 0487d1f..a1682ef 100644
--- a/libdde_linux26/contrib/lib/kobject.c
+++ b/libdde_linux26/contrib/lib/kobject.c
@@ -794,7 +794,7 @@ static struct kset *kset_create(const char *name,
        kset = kzalloc(sizeof(*kset), GFP_KERNEL);
        if (!kset)
                return NULL;
-       kobject_set_name(&kset->kobj, name);
+       kobject_set_name(&kset->kobj, "%s", name);
        kset->uevent_ops = uevent_ops;
        kset->kobj.parent = parent_kobj;
 
diff --git a/libdde_linux26/contrib/net/core/net-sysfs.c 
b/libdde_linux26/contrib/net/core/net-sysfs.c
index 484f587..2da59a0 100644
--- a/libdde_linux26/contrib/net/core/net-sysfs.c
+++ b/libdde_linux26/contrib/net/core/net-sysfs.c
@@ -498,7 +498,7 @@ int netdev_register_kobject(struct net_device *net)
        dev->groups = groups;
 
        BUILD_BUG_ON(BUS_ID_SIZE < IFNAMSIZ);
-       dev_set_name(dev, net->name);
+       dev_set_name(dev, "%s", net->name);
 
 #ifdef CONFIG_SYSFS
        *groups++ = &netstat_group;
diff --git a/libdde_linux26/lib/src/drivers/base/core.c 
b/libdde_linux26/lib/src/drivers/base/core.c
index e380071..c6363dd 100644
--- a/libdde_linux26/lib/src/drivers/base/core.c
+++ b/libdde_linux26/lib/src/drivers/base/core.c
@@ -1253,7 +1253,7 @@ struct device *__root_device_register(const char *name, 
struct module *owner)
        if (!root)
                return ERR_PTR(err);
 
-       err = dev_set_name(&root->dev, name);
+       err = dev_set_name(&root->dev, "%s", name);
        if (err) {
                kfree(root);
                return ERR_PTR(err);

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]