From patchwork Fri Apr 29 09:19:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 8978741 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3423BBF29F for ; Fri, 29 Apr 2016 09:20:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3D972021A for ; Fri, 29 Apr 2016 09:20:19 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 066F4200FF for ; Fri, 29 Apr 2016 09:20:19 +0000 (UTC) Received: from localhost ([::1]:53417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw4aw-0004Kx-Dv for patchwork-qemu-devel@patchwork.kernel.org; Fri, 29 Apr 2016 05:20:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw4Zy-0002Yc-IT for qemu-devel@nongnu.org; Fri, 29 Apr 2016 05:19:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aw4Zs-0000hZ-Bz for qemu-devel@nongnu.org; Fri, 29 Apr 2016 05:19:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw4Zs-0000hM-7G for qemu-devel@nongnu.org; Fri, 29 Apr 2016 05:19:12 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D32CEC062C90 for ; Fri, 29 Apr 2016 09:19:10 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-66.ams2.redhat.com [10.36.116.66]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3T9J9fH007465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 29 Apr 2016 05:19:10 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C6D0C1132D8B; Fri, 29 Apr 2016 11:19:08 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Fri, 29 Apr 2016 11:19:08 +0200 Message-Id: <1461921548-3332-2-git-send-email-armbru@redhat.com> In-Reply-To: <1461921548-3332-1-git-send-email-armbru@redhat.com> References: <1461921548-3332-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL for-2.6 1/1] qapi: Don't pass NULL to printf in string input visitor X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Blake Make sure the error message for visit_type_uint64() gracefully handles a NULL 'name' when called from the top level or a list context, as not all the world behaves like glibc in allowing NULL through a printf-family %s. Signed-off-by: Eric Blake Message-Id: <1461879932-9020-21-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster --- qapi/string-input-visitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c index ab12953..5ea2d77 100644 --- a/qapi/string-input-visitor.c +++ b/qapi/string-input-visitor.c @@ -222,7 +222,7 @@ static void parse_type_int64(Visitor *v, const char *name, int64_t *obj, return; error: - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name, + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null", "an int64 value or range"); }