From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw4LG-00044L-8R for qemu-devel@nongnu.org; Fri, 29 Apr 2016 05:04:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aw4KW-0004s9-1O for qemu-devel@nongnu.org; Fri, 29 Apr 2016 05:04:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw4KV-0004rx-T4 for qemu-devel@nongnu.org; Fri, 29 Apr 2016 05:03:19 -0400 From: Markus Armbruster References: <1461879932-9020-1-git-send-email-eblake@redhat.com> <1461879932-9020-21-git-send-email-eblake@redhat.com> Date: Fri, 29 Apr 2016 11:03:17 +0200 In-Reply-To: <1461879932-9020-21-git-send-email-eblake@redhat.com> (Eric Blake's message of "Thu, 28 Apr 2016 15:45:28 -0600") Message-ID: <871t5o7pnu.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [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: Eric Blake Cc: qemu-devel@nongnu.org, Michael Roth Eric Blake writes: > 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"); > } Crash bug, nominating the fix for 2.6 (I'll post a pull request), or else -stable. Reviewed-by: Markus Armbruster