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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Aleksey,

On Wed, Aug 17, 2016 at 10:58:06AM +0300, Aleksey Kuleshov wrote:
> Signed-off-by: Aleksey Kuleshov <rndfax@xxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxxxxxxx
> 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 |

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



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux