remove_quotes_in_str() doesn't stop parsing at the string end when
there's a single "'" in the string.
Handling quotes and double quotes is broken in many ways in hush, so
I am not exactly sure this is the right thing to do, but at least it
avoids going out of the string boundaries.

Signed-off-by: Sascha Hauer <s.ha...@pengutronix.de>
---
 common/hush.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/hush.c b/common/hush.c
index 9ced67af48..44ce4e5225 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -623,8 +623,11 @@ static void remove_quotes_in_str(char *src)
        while (*src) {
                if (*src == '\'') {
                        src++;
-                       while (*src != '\'')
+                       while (*src != '\'') {
+                               if (!*src)
+                                       return;
                                *trg++ = *src++;
+                       }
                        src++;
                        continue;
                }
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to