From patchwork Tue Mar 4 06:15:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 25653 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 967632066C for ; Tue, 4 Mar 2014 06:41:03 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id i17sf1461953qcy.7 for ; Mon, 03 Mar 2014 22:41:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=5FTA9/EgU8onAmxTmFqDu5HWL55Kc2Fmo8GWvZpFwKI=; b=bjLLnEPhrbHAn8cfNrgdPIPkLjcy1V4ScdevB3txuE7rjryZz2n4eYuxMhJnBbS5DM sYrZ6N6BYL6XtT9lHRzFUdTrUScdLVTCrYU34HN0UmaD7v979KEYt7skNaaM+2kTk3bo C90gh/wPuwqSpYjPhEn1McynaLtrqxa+E8M9I38jj5aWrDeFPAfn1dHHAhlpOXYb+bta 2moQc7futEoqLpwJh+zXPt3BJDnvBYgt3r7o4E4HWeU57fO+VqYnwaGJmYtrlYSfyYKS 39WmmdTRHo39ChT5FLkQYq4NA0GgXsJ1yLZ+XHHmv4fWm6yxG7R+9PRvMGK44AOzadff MP4Q== X-Gm-Message-State: ALoCoQnKHXYBP1Nn/b/DyjJeL4Os5eO9HVs5qBkZtHQlq8T0YY+5vfJhKEaxdoBw+1P7N4cGRWd5 X-Received: by 10.236.126.170 with SMTP id b30mr9111455yhi.49.1393915263374; Mon, 03 Mar 2014 22:41:03 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.241 with SMTP id t104ls2516657qgt.21.gmail; Mon, 03 Mar 2014 22:41:03 -0800 (PST) X-Received: by 10.58.77.204 with SMTP id u12mr1005581vew.29.1393915263239; Mon, 03 Mar 2014 22:41:03 -0800 (PST) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id f7si5501569vcz.132.2014.03.03.22.41.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Mar 2014 22:41:03 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so2309837veb.41 for ; Mon, 03 Mar 2014 22:41:03 -0800 (PST) X-Received: by 10.220.99.7 with SMTP id s7mr20450442vcn.19.1393915263168; Mon, 03 Mar 2014 22:41:03 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.130.193 with SMTP id u1csp106165vcs; Mon, 3 Mar 2014 22:41:02 -0800 (PST) X-Received: by 10.140.101.162 with SMTP id u31mr463872qge.107.1393915262678; Mon, 03 Mar 2014 22:41:02 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d2si7352303qag.112.2014.03.03.22.41.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 03 Mar 2014 22:41:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:43383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKiwv-0004tP-3v for patch@linaro.org; Tue, 04 Mar 2014 01:35:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKiw1-0004CB-Q0 for qemu-devel@nongnu.org; Tue, 04 Mar 2014 01:34:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKivw-0007dk-1m for qemu-devel@nongnu.org; Tue, 04 Mar 2014 01:34:37 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:43579) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKivv-0007dT-Qp; Tue, 04 Mar 2014 01:34:31 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id BFE4040852; Tue, 4 Mar 2014 10:34:30 +0400 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id E682C668; Tue, 4 Mar 2014 10:16:04 +0400 (MSK) Received: (nullmailer pid 16586 invoked by uid 1000); Tue, 04 Mar 2014 06:16:03 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Tue, 4 Mar 2014 10:15:56 +0400 Message-Id: <1393913761-16516-9-git-send-email-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1393913761-16516-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1393913761-16516-1-git-send-email-mjt@msgid.tls.msk.ru> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Tokarev Subject: [Qemu-devel] [PULL 08/13] qjson.h: Remove spurious GCC_FMT_ATTR markup from qobject_from_json() declaration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mjt@tls.msk.ru X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Peter Maydell The function qobject_from_json() doesn't actually allow its argument to be a format string -- it passes a NULL va_list* to qobject_from_jsonv(), and the parser code will then never actually interpret %-escape sequences (it tests whether the va_list pointer is NULL and will stop with a parse error). The spurious attribute markup causes clang warnings in some of the test cases where we programmatically construct JSON to feed to qobject_from_json(): tests/test-qmp-input-visitor.c:76:35: warning: format string is not a string literal (potentially insecure) [-Wformat-security] data->obj = qobject_from_json(json_string); ^~~~~~~~~~~ Remove the incorrect attribute. Signed-off-by: Peter Maydell Suggested-by: Paolo Bonzini Reviewed-by: Eric Blake Reviewed-by: Andreas Färber Signed-off-by: Michael Tokarev --- include/qapi/qmp/qjson.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qapi/qmp/qjson.h b/include/qapi/qmp/qjson.h index 73351ed..ee4d31a 100644 --- a/include/qapi/qmp/qjson.h +++ b/include/qapi/qmp/qjson.h @@ -19,7 +19,7 @@ #include "qapi/qmp/qobject.h" #include "qapi/qmp/qstring.h" -QObject *qobject_from_json(const char *string) GCC_FMT_ATTR(1, 0); +QObject *qobject_from_json(const char *string); QObject *qobject_from_jsonf(const char *string, ...) GCC_FMT_ATTR(1, 2); QObject *qobject_from_jsonv(const char *string, va_list *ap) GCC_FMT_ATTR(1, 0);