* [PATCH] Fix uninitialized name_list::ignore_error
@ 2008-08-31 17:22 Alan Jenkins
0 siblings, 0 replies; 2+ messages in thread
From: Alan Jenkins @ 2008-08-31 17:22 UTC (permalink / raw)
To: linux-hotplug
Running udevd under valgrind (and then udevtrigger):
=17705= Conditional jump or move depends on uninitialised value(s)
=17705= at 0x407BBB: udev_rules_run (udev_rules.c:522)
=17705= by 0x4109F0: udev_event_process (udevd.c:145)
=17705= by 0x410E2C: udev_event_run (udevd.c:251)
=17705= by 0x411A8D: msg_queue_manager (udevd.c:581)
=17705= by 0x41386B: main (udevd.c:1284)
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
diff --git a/udev/udev_utils.c b/udev/udev_utils.c
index 9b22de7..d1d3acb 100644
--- a/udev/udev_utils.c
+++ b/udev/udev_utils.c
@@ -77,6 +77,7 @@ struct name_entry *name_list_add(struct list_head *name_list, const char *name,
name_new = malloc(sizeof(struct name_entry));
if (name_new = NULL)
return NULL;
+ memset(name_new, 0x00, sizeof(struct name_entry));
strlcpy(name_new->name, name, sizeof(name_new->name));
dbg("adding '%s'\n", name_new->name);
@@ -102,6 +103,7 @@ struct name_entry *name_list_key_add(struct list_head *name_list, const char *ke
name_new = malloc(sizeof(struct name_entry));
if (name_new = NULL)
return NULL;
+ memset(name_new, 0x00, sizeof(struct name_entry));
snprintf(name_new->name, sizeof(name_new->name), "%s=%s", key, value);
name_new->name[sizeof(name_new->name)-1] = '\0';
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix uninitialized name_list::ignore_error
@ 2008-09-01 14:37 Kay Sievers
0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2008-09-01 14:37 UTC (permalink / raw)
To: linux-hotplug
On Sun, Aug 31, 2008 at 19:22, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
> Running udevd under valgrind (and then udevtrigger):
>
> =17705= Conditional jump or move depends on uninitialised value(s)
> =17705= at 0x407BBB: udev_rules_run (udev_rules.c:522)
> =17705= by 0x4109F0: udev_event_process (udevd.c:145)
> =17705= by 0x410E2C: udev_event_run (udevd.c:251)
> =17705= by 0x411A8D: msg_queue_manager (udevd.c:581)
> =17705= by 0x41386B: main (udevd.c:1284)
>
> Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
>
> diff --git a/udev/udev_utils.c b/udev/udev_utils.c
> index 9b22de7..d1d3acb 100644
> --- a/udev/udev_utils.c
> +++ b/udev/udev_utils.c
> @@ -77,6 +77,7 @@ struct name_entry *name_list_add(struct list_head *name_list, const char *name,
> name_new = malloc(sizeof(struct name_entry));
> if (name_new = NULL)
> return NULL;
> + memset(name_new, 0x00, sizeof(struct name_entry));
>
> strlcpy(name_new->name, name, sizeof(name_new->name));
> dbg("adding '%s'\n", name_new->name);
> @@ -102,6 +103,7 @@ struct name_entry *name_list_key_add(struct list_head *name_list, const char *ke
> name_new = malloc(sizeof(struct name_entry));
> if (name_new = NULL)
> return NULL;
> + memset(name_new, 0x00, sizeof(struct name_entry));
>
> snprintf(name_new->name, sizeof(name_new->name), "%s=%s", key, value);
> name_new->name[sizeof(name_new->name)-1] = '\0';
Applied.
Thanks,
Kay
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-01 14:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-31 17:22 [PATCH] Fix uninitialized name_list::ignore_error Alan Jenkins
-- strict thread matches above, loose matches on Subject: below --
2008-09-01 14:37 Kay Sievers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).