[PATCH 1/2] hush: do not do anything if string is zero length

Aleksey Kuleshov rndfax at yandex.ru
Wed Aug 17 00:58:06 PDT 2016


Signed-off-by: Aleksey Kuleshov <rndfax at yandex.ru>
---
 common/hush.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/hush.c b/common/hush.c
index d3f7bf3..d8fd64b 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -1655,6 +1655,9 @@ char *shell_expand(char *str)
 	o_string o = {};
 	char *res, *parsed;
 
+	if (strlen(str) == 0)
+		return xstrdup("");
+
 	remove_quotes_in_str(str);
 
 	o.quote = 1;
-- 
2.8.0.rc3




More information about the barebox mailing list