All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] env: don't add an empty key to the env hashtable
@ 2013-04-27 21:56 Lucian Cojocar
  2013-04-27 22:35 ` Wolfgang Denk
  0 siblings, 1 reply; 6+ messages in thread
From: Lucian Cojocar @ 2013-04-27 21:56 UTC (permalink / raw)
  To: u-boot

If the environment contains an entry like "=value" "\0" we should skip
this key/value. Otherwise, U-Boot will enter in an infinite loop.

Signed-off-by: Lucian Cojocar <cojocar@gmail.com>
---
 lib/hashtable.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/hashtable.c b/lib/hashtable.c
index 07ebfb2..8f5a6f8 100644
--- a/lib/hashtable.c
+++ b/lib/hashtable.c
@@ -870,6 +870,10 @@ int himport_r(struct hsearch_data *htab,
 		*sp++ = '\0';	/* terminate value */
 		++dp;
 
+		/* skip this entry if the name is empty */
+		if (*name == 0)
+			continue;
+
 		/* Skip variables which are not supposed to be processed */
 		if (!drop_var_from_set(name, nvars, localvars))
 			continue;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-05-10 19:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-27 21:56 [U-Boot] [PATCH] env: don't add an empty key to the env hashtable Lucian Cojocar
2013-04-27 22:35 ` Wolfgang Denk
2013-04-27 23:08   ` Lucian Cojocar
2013-04-28  9:06     ` Wolfgang Denk
2013-04-28 21:31       ` [U-Boot] [PATCH v2] env: throw an error when an empty key is used Lucian Cojocar
2013-05-10 19:58         ` [U-Boot] [U-Boot, " Tom Rini

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.