From patchwork Wed Nov 20 11:59:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1198077 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AOxyUW6b"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47J1Vt4vnSz9sPj for ; Wed, 20 Nov 2019 23:01:10 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7X3zGc6MZ1lVFEfOe457etDb0kNsEhNE5Gp7WHOOT74=; b=AOxyUW6bThKM9N dRkQENGfkfEI1+5SK2O1bA7Ziw+f4BVWXmw5+9L3yo4FbwEJ1h+nnzRbvYZPuvM2gKJ8kdJQNHCop jEtTYvuO27SPI0Gc/y5eKKAupUWhZRNZa2cLNVHf1FhyPeDzkV7zMEkRWMGs3Z+XgXlmRpzQqAsHx 0IcLKGlawk+6+SdsjhVAuJpSDqpDGuzraQ4NH7fFgfwB1kQtPVtno0iDbAO5cjdUDbMFyuTTRon2b TI4nVpSLT2Sb6wAOhV3Xorf2bYYAAjDmT8x0rPSmSzdDy4hwGZVEClZAYS4PK0GmCJ9CI6aZmA+fk u4hxUyoI94bapyggQRvg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXOfQ-0004Xt-6D; Wed, 20 Nov 2019 12:01:04 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXOe6-0001a0-Fc for openwrt-devel@lists.openwrt.org; Wed, 20 Nov 2019 11:59:44 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id EDB414674; Wed, 20 Nov 2019 12:59:32 +0100 (CET) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 4ba09a2c; Wed, 20 Nov 2019 12:59:23 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Wed, 20 Nov 2019 12:59:25 +0100 Message-Id: <20191120115926.23272-9-ynezz@true.cz> In-Reply-To: <20191120115926.23272-1-ynezz@true.cz> References: <20191120115926.23272-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191120_035942_703339_2913201C X-CRM114-Status: UNSURE ( 7.53 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH libubox 8/9] blobmsg_json: fix possible uninitialized struct member X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org clang-10 analyzer reports following: blobmsg_json.c:285:2: warning: The expression is an uninitialized value. The computed value will also be garbage s->indent_level++; ^~~~~~~~~~~~~~~~~ Signed-off-by: Petr Štetiar --- blobmsg_json.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blobmsg_json.c b/blobmsg_json.c index a5980e8a2b62..18592111b4dd 100644 --- a/blobmsg_json.c +++ b/blobmsg_json.c @@ -315,7 +315,7 @@ static void setup_strbuf(struct strbuf *s, struct blob_attr *attr, blobmsg_json_ char *blobmsg_format_json_with_cb(struct blob_attr *attr, bool list, blobmsg_json_format_t cb, void *priv, int indent) { - struct strbuf s; + struct strbuf s = {0}; bool array; char *ret; @@ -349,7 +349,7 @@ char *blobmsg_format_json_with_cb(struct blob_attr *attr, bool list, blobmsg_jso char *blobmsg_format_json_value_with_cb(struct blob_attr *attr, blobmsg_json_format_t cb, void *priv, int indent) { - struct strbuf s; + struct strbuf s = {0}; char *ret; setup_strbuf(&s, attr, cb, priv, indent);