[lxc-devel] [PATCH] do not crash if specs is NULL

Stéphane Graber stgraber at ubuntu.com
Thu Feb 27 20:08:54 UTC 2014


On Thu, Feb 27, 2014 at 02:16:05PM -0500, S.Çağlar Onur wrote:
> Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>

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

> ---
>  src/lxc/bdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c
> index 18f1770..627c09a 100644
> --- a/src/lxc/bdev.c
> +++ b/src/lxc/bdev.c
> @@ -484,7 +484,7 @@ static int dir_destroy(struct bdev *orig)
>  static int dir_create(struct bdev *bdev, const char *dest, const char *n,
>  			struct bdev_specs *specs)
>  {
> -	if (specs->dir)
> +	if (specs && specs->dir)
>  		bdev->src = strdup(specs->dir);
>  	else
>  		bdev->src = strdup(dest);
> -- 
> 1.8.3.2
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/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: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140227/74be082e/attachment.pgp>


More information about the lxc-devel mailing list