On Fri, 2015-07-10 at 19:00 +0100, Wei Liu wrote:
> Don't dereference NULL.

Subject: xl: correctly handle null extra config in main_config_update

> 
> Signed-off-by: Wei Liu <wei.l...@citrix.com>
> ---
>  tools/libxl/xl_cmdimpl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index d44eb4b..631dbd1 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -5010,7 +5010,7 @@ int main_config_update(int argc, char **argv)
>          if (rc) { fprintf(stderr, "Failed to read config file: %s: %s\n",
>                             filename, strerror(errno));
>                    free(extra_config); return ERROR_FAIL; }
> -        if (strlen(extra_config)) {
> +        if (extra_config && strlen(extra_config)) {
>              if (config_len > INT_MAX - (strlen(extra_config) + 2 + 1)) {
>                  fprintf(stderr, "Failed to attach extra configration\n");
>                  exit(1);



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to