Lucian Cojocar
2013-04-27 21:56:27 UTC
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 at 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;
this key/value. Otherwise, U-Boot will enter in an infinite loop.
Signed-off-by: Lucian Cojocar <cojocar at 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
1.7.9.5