From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: [PATCH 9/9] xl: fix main_config_update Date: Fri, 10 Jul 2015 19:00:57 +0100 Message-ID: <1436551257-28887-10-git-send-email-wei.liu2@citrix.com> References: <1436551257-28887-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZDcbj-0002G9-2h for xen-devel@lists.xenproject.org; Fri, 10 Jul 2015 18:01:07 +0000 In-Reply-To: <1436551257-28887-1-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Ian Jackson , Ian Campbell , Wei Liu List-Id: xen-devel@lists.xenproject.org Don't dereference NULL. Signed-off-by: Wei Liu --- 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); -- 1.9.1