Received: from eggs.gnu.org ([2001:4830:134:3::10]:39080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azjzK-0002jM-2b for qemu-devel@nongnu.org; Mon, 09 May 2016 08:08:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azjzD-0004SV-N5 for qemu-devel@nongnu.org; Mon, 09 May 2016 08:08:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azjzD-0004SQ-Gf for qemu-devel@nongnu.org; Mon, 09 May 2016 08:08:31 -0400 From: Stefan Hajnoczi Date: Mon, 9 May 2016 13:07:53 +0100 Message-Id: <1462795687-25698-10-git-send-email-stefanha@redhat.com> In-Reply-To: <1462795687-25698-1-git-send-email-stefanha@redhat.com> References: <1462795687-25698-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH v2 09/23] qapi: Don't pass NULL to printf in string input visitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: marc.mari.barcelo@gmail.com, Paolo Bonzini , jsnow@redhat.com, Eric Blake , Markus Armbruster 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"); } -- 2.5.5