* [PATCH] dtc: zero out new label objects
@ 2012-09-28 18:39 Stephen Warren
[not found] ` <1348857562-14680-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2012-09-28 18:39 UTC (permalink / raw)
To: David Gibson, Jon Loeliger
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Stephen Warren
From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Without this, new->deleted may be left set to some random value, which
may then cause future label references to fail to locate the label. The
code that allocates properties and nodes already contains the equivalent
memset().
Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
livetree.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/livetree.c b/livetree.c
index e856662..b61465f 100644
--- a/livetree.c
+++ b/livetree.c
@@ -36,6 +36,7 @@ void add_label(struct label **labels, char *label)
}
new = xmalloc(sizeof(*new));
+ memset(new, 0, sizeof(*new));
new->label = label;
new->next = *labels;
*labels = new;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dtc: zero out new label objects
[not found] ` <1348857562-14680-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2012-09-28 20:35 ` Jon Loeliger
0 siblings, 0 replies; 2+ messages in thread
From: Jon Loeliger @ 2012-09-28 20:35 UTC (permalink / raw)
To: Stephen Warren; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Stephen Warren
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> Without this, new->deleted may be left set to some random value, which
> may then cause future label references to fail to locate the label. The
> code that allocates properties and nodes already contains the equivalent
> memset().
>
> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Applied and pushed out.
Thanks,
jdl
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-28 20:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-28 18:39 [PATCH] dtc: zero out new label objects Stephen Warren
[not found] ` <1348857562-14680-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-09-28 20:35 ` Jon Loeliger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.