[lxc-devel] [PATCH] fix lxc-info segv on stopped container

Stéphane Graber stgraber at ubuntu.com
Wed Oct 2 16:20:58 UTC 2013


On Wed, Oct 02, 2013 at 12:14:58PM -0400, Dwight Engen wrote:
> Signed-off-by: Dwight Engen <dwight.engen at oracle.com>

Doh, not sure how I managed to miss that one!

Thanks!

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  src/lxc/lxc_info.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/src/lxc/lxc_info.c b/src/lxc/lxc_info.c
> index 23cf789..a4fa3e1 100644
> --- a/src/lxc/lxc_info.c
> +++ b/src/lxc/lxc_info.c
> @@ -124,12 +124,14 @@ int main(int argc, char *argv[])
>  
>  	if (ips) {
>  		char **addresses = c->get_ips(c, NULL, NULL, 0);
> -		char *address;
> -		i = 0;
> -		while (addresses[i]) {
> -			address = addresses[i];
> -			printf("ip: \t%s\n", address);
> -			i++;
> +		if (addresses) {
> +			char *address;
> +			i = 0;
> +			while (addresses[i]) {
> +				address = addresses[i];
> +				printf("ip: \t%s\n", address);
> +				i++;
> +			}
>  		}
>  	}
>  
> -- 
> 1.8.1.4
> 
> 
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20131002/15f35067/attachment.pgp>


More information about the lxc-devel mailing list