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

Sascha Hauer s.hauer at pengutronix.de
Wed Aug 17 23:35:24 PDT 2016


Hi Aleksey,

On Wed, Aug 17, 2016 at 10:58:06AM +0300, Aleksey Kuleshov wrote:
> 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("");
> +

Can you explain why this is necessary? What happens with an empty string
without this patch?

Sascha

>  	remove_quotes_in_str(str);
>  
>  	o.quote = 1;
> -- 
> 2.8.0.rc3
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list