Received: from eggs.gnu.org ([2001:4830:134:3::10]:55148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avtko-0007zA-MD for qemu-devel@nongnu.org; Thu, 28 Apr 2016 17:45:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avtkn-0000IN-36 for qemu-devel@nongnu.org; Thu, 28 Apr 2016 17:45:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avtkm-0000ID-VF for qemu-devel@nongnu.org; Thu, 28 Apr 2016 17:45:45 -0400 From: Eric Blake Date: Thu, 28 Apr 2016 15:45:28 -0600 Message-Id: <1461879932-9020-21-git-send-email-eblake@redhat.com> In-Reply-To: <1461879932-9020-1-git-send-email-eblake@redhat.com> References: <1461879932-9020-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH v16 20/24] 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: armbru@redhat.com, Michael Roth 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 --- v16: split off NULL handling v15: new patch --- 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 797973a..b55d199 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