From patchwork Tue Aug 1 11:25:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9874267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4425160365 for ; Tue, 1 Aug 2017 11:28:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A1DD28567 for ; Tue, 1 Aug 2017 11:28:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D90D285F9; Tue, 1 Aug 2017 11:28:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B62428567 for ; Tue, 1 Aug 2017 11:28:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcVJh-0005Wu-L8; Tue, 01 Aug 2017 11:26:25 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcVJg-0005Wo-J1 for xen-devel@lists.xenproject.org; Tue, 01 Aug 2017 11:26:24 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id 7D/AA-01724-F5560895; Tue, 01 Aug 2017 11:26:23 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPLMWRWlGSWpSXmKPExsXitHSDvW58akO kQedXcYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNeNY6wyWgqOsFQ+7zrE0MK5g6WLk5JAQ8Jf4 efgvM4jNJqAs8bOzlw3EFhHQk2g68JwRxGYW8JL4saKHHcQWFnCUeHLvOyuIzSKgInHozD2wX l4Bc4nfh+ZBzZSX2NV2EaxGSEBBomP6MSaIGkGJkzOfsEDMlJA4+OIF8wRG7llIUrOQpBYwMq 1i1ChOLSpLLdI1MtVLKspMzyjJTczM0TU0MNbLTS0uTkxPzUlMKtZLzs/dxAgMhnoGBsYdjK0 n/A4xSnIwKYnyKvbURwrxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4H2Z3BApJFiUmp5akZaZAwxL mLQEB4+SCO8+kDRvcUFibnFmOkTqFKMxR9OHLV+YOF5N+P+NSYglLz8vVUqc9yxIqQBIaUZpH twgWLxcYpSVEuZlZGBgEOIpSC3KzSxBlX/FKM7BqCTMexpkCk9mXgncvldApzABnSJZWgtySk kiQkqqgVHjnIX7+veCX3WU1wWbfnl26eoZ1W/VE0VDFrbF7ec/8kJ/+xQO9xldm0895D2wPtj 9k7zeRZmfH4TOKTy6ueesS9PptY9qHDX3Tc45fa454ppsrPsepl3SfzSWRCmv2BncMXOr67a8 9Ymvw8y+fwr/c3r2+2kbPZQZymYdPlxVlDljwbMtfpGflFiKMxINtZiLihMB3kQjk5ICAAA= X-Env-Sender: prvs=379b27b57=wei.liu2@citrix.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1501586781!104022938!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46359 invoked from network); 1 Aug 2017 11:26:23 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-15.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 1 Aug 2017 11:26:23 -0000 X-IronPort-AV: E=Sophos;i="5.41,306,1498521600"; d="scan'208";a="442173601" From: Wei Liu To: Xen-devel Date: Tue, 1 Aug 2017 12:25:39 +0100 Message-ID: <20170801112539.6537-1-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Cc: Wei Liu , Ian Jackson Subject: [Xen-devel] [PATCH] libxc: check pointer is not null before printing X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Wei Liu Acked-by: Ian Jackson --- tools/libxc/xc_dom_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c index cf403432d2..b5f316a1dc 100644 --- a/tools/libxc/xc_dom_core.c +++ b/tools/libxc/xc_dom_core.c @@ -754,7 +754,8 @@ struct xc_dom_image *xc_dom_allocate(xc_interface *xch, struct xc_dom_image *dom; xc_dom_printf(xch, "%s: cmdline=\"%s\", features=\"%s\"", - __FUNCTION__, cmdline, features); + __FUNCTION__, cmdline ? cmdline : "", + features ? features : ""); dom = malloc(sizeof(*dom)); if ( !dom ) goto err;