From patchwork Sat Nov 13 02:35:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tedd Ho-Jeong An X-Patchwork-Id: 12617525 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06AB5C433EF for ; Sat, 13 Nov 2021 02:36:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CECB861057 for ; Sat, 13 Nov 2021 02:36:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233171AbhKMCix (ORCPT ); Fri, 12 Nov 2021 21:38:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231618AbhKMCiw (ORCPT ); Fri, 12 Nov 2021 21:38:52 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 754CCC061766 for ; Fri, 12 Nov 2021 18:36:01 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id b68so9948733pfg.11 for ; Fri, 12 Nov 2021 18:36:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=JRrAXH+ErzMdl3C5zM7lid4/LDebLcY0b1kuEmm5RPs=; b=BBllkQ5/egmh586yyRdfrMW0v6o7rqQQddqS4LG850CdbqwekW+LPrPIOx/nuwh7kq giQIBI7rs/DVNlIm4fn2YGymR19fijL1w6STE5dptri07PDBjzyLsehZkPFQzh8iNvtQ IBPXjWe2QpqDQPVBTbYE8F6zl6GPuuVlX9FhHSrtFEvOO1aFNuGEKumxwZEpRaBgsEbI oL3oXYFG6uB2QJcSkzw6tTDlisQKTKaarmg0XHhNTo/NxL6zYlaFF0fVL8POd7mTX2Hm ZgsBjDSchty1AX2KOhojs4SZjnNWc0HUtjabmOhLxT+XUHy9OvOdMY21Ef803JMydD6y 30mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=JRrAXH+ErzMdl3C5zM7lid4/LDebLcY0b1kuEmm5RPs=; b=VUlaxEASn3qVHsc7FBx6s3nz+OSLfhgG0r9mgNlljLrjzG0NMdPXT0Ip4j86E2aI7T l2VyEJRLTgCRhem4iAP9U6PdS4IeCrW6vpSU5ZNEfVUiR6y7dDGLB+jJ+8X4gfN047l1 Jr74Lpng9rKdz3e8ymuIvQ9rS2wT4kLSgvDHIv961u/FPfaxftOP9PvzPZhNtymPi7W6 RkNvU41jk+HTUTEUkvmmIWj1WIKSbcVs8hrirPJ6Dqybhoit6Rp8wwT525l30kKZt1n1 Rsb6CUqPSHQnE9qfCCNZ82+NDmm7w9LJg4Hy/rSwGUd7EJhpt9Bq93pbTIB8weHy84B7 A/yw== X-Gm-Message-State: AOAM5324wPURRXxN3k7DR+N/NAiAV1kSBB4gO52TVEDB+CFQ27W2v2Ry c4MOUWZbgm2MqisRjdzG+ueMgZ/tgXk= X-Google-Smtp-Source: ABdhPJyhXwklr9vJWdeDPlw03IZSmvjRZnfHMHajMfoHtcZNgMqmo87Nl8FNKrJUsB04Y3/dZUrwCw== X-Received: by 2002:a63:2a97:: with SMTP id q145mr13210819pgq.217.1636770960670; Fri, 12 Nov 2021 18:36:00 -0800 (PST) Received: from han1-NUC8i7BEH.hsd1.or.comcast.net ([2601:1c0:6a01:d830:5c5a:3570:def6:e3d5]) by smtp.gmail.com with ESMTPSA id co4sm12006768pjb.2.2021.11.12.18.35.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 18:36:00 -0800 (PST) From: Tedd Ho-Jeong An To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH 1/3] emulator: Fix uninitiailzed scalar variable Date: Fri, 12 Nov 2021 18:35:57 -0800 Message-Id: <20211113023559.212793-1-hj.tedd.an@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Tedd Ho-Jeong An This patch fixes the uninitiailzed varialble(CWE-457) reported by the Coverity scan. --- emulator/bthost.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/emulator/bthost.c b/emulator/bthost.c index 61f1cd361..66e337f34 100644 --- a/emulator/bthost.c +++ b/emulator/bthost.c @@ -1570,6 +1570,7 @@ static void rfcomm_sabm_send(struct bthost *bthost, struct btconn *conn, { struct rfcomm_cmd cmd; + memset(&cmd, 0, sizeof(cmd)); cmd.address = RFCOMM_ADDR(cr, dlci); cmd.control = RFCOMM_CTRL(RFCOMM_SABM, 1); cmd.length = RFCOMM_LEN8(0); @@ -2123,6 +2124,7 @@ static void rfcomm_ua_send(struct bthost *bthost, struct btconn *conn, { struct rfcomm_cmd cmd; + memset(&cmd, 0, sizeof(cmd)); cmd.address = RFCOMM_ADDR(cr, dlci); cmd.control = RFCOMM_CTRL(RFCOMM_UA, 1); cmd.length = RFCOMM_LEN8(0); @@ -2136,6 +2138,7 @@ static void rfcomm_dm_send(struct bthost *bthost, struct btconn *conn, { struct rfcomm_cmd cmd; + memset(&cmd, 0, sizeof(cmd)); cmd.address = RFCOMM_ADDR(cr, dlci); cmd.control = RFCOMM_CTRL(RFCOMM_DM, 1); cmd.length = RFCOMM_LEN8(0); From patchwork Sat Nov 13 02:35:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tedd Ho-Jeong An X-Patchwork-Id: 12617527 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B24CFC433F5 for ; Sat, 13 Nov 2021 02:36:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92A2861057 for ; Sat, 13 Nov 2021 02:36:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233303AbhKMCiy (ORCPT ); Fri, 12 Nov 2021 21:38:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233014AbhKMCix (ORCPT ); Fri, 12 Nov 2021 21:38:53 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1885CC061766 for ; Fri, 12 Nov 2021 18:36:02 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id c126so10036979pfb.0 for ; Fri, 12 Nov 2021 18:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=QVLnziUGxzmQ8ZRD+mJLVHBAZV2oPwOBZwmqQicfOMM=; b=Cgm3+3Wcltsxb/iTLOo/v0QmJt2MrXieFnafv77Y+SKuecJaMMFXdQ1CCpDVlpSnDg JuVxlVrzOFD6W255jagvq2WofBizCMU99kTVu4CeQTE5oZUDgZia2/lZdqQBd81rmRA5 SBvNt1Y1Mz7CuJDXYwTO85S2MsvROisGuYdEu2cJWbbBg+MlROiJaNTrhVAKh7Hw4mA9 vaf63b4b6Ja7XgfXq2exuU05TI5Wpgx2QrBuaVIdYDyh7tNJRP2GgxOBKl+hwdt4wU7n LxV/fS4k1nz673FwwAEg30neylhNFayvlRDW3qO/8PXR76rzHGG6wmt/9oa3lvvA8mY+ wzdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QVLnziUGxzmQ8ZRD+mJLVHBAZV2oPwOBZwmqQicfOMM=; b=j718XMKgetlFfMnruybd4hzdWXRbTjuChugsB3EBvAARKH/Z2wGUBwXBUXLreQJmPA q1lKM4TA9WX8PBOYjBR37n+37swILLCgWEwDfAbWu6rIr9H8yif3cVAdw3Mudr9yjcSX X55+dN8wki2bAXMqjt94gVbmrdkcHPl0OTZ4TSICv1QWAWhtTJXydJiz/DbZ+3ciu4mC 5P3Ywda000p/OuNVJDWOguf4jl24wFmR8r7l32U/CPvy1yT0KTEjGix5s1cgcRx8+by6 fzoaPGuSDnsxlWJwI4/UakI+Lbbri3Xs7DzvNQmKn10j40kkD2Mm+WTmZClq3HIy5XlI Ny6A== X-Gm-Message-State: AOAM530eubZYJaylNa13kfBFyejeUIp/2WsZ224Xg4/PMYzojj7QR5IG Ut15BJnMy+EaCRb2TIjr0GZ9PEp1/3s= X-Google-Smtp-Source: ABdhPJxadXzCAfVRGxnFHS/EHLoQbTVCaBr1+yiYYo0Nm/cSCr8V16SkcpYWwp4qI4pMCWHxqcvOcA== X-Received: by 2002:a63:790d:: with SMTP id u13mr12553857pgc.150.1636770961337; Fri, 12 Nov 2021 18:36:01 -0800 (PST) Received: from han1-NUC8i7BEH.hsd1.or.comcast.net ([2601:1c0:6a01:d830:5c5a:3570:def6:e3d5]) by smtp.gmail.com with ESMTPSA id co4sm12006768pjb.2.2021.11.12.18.36.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 18:36:00 -0800 (PST) From: Tedd Ho-Jeong An To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH 2/3] monitor: Fix uninitiailzed scalar variable Date: Fri, 12 Nov 2021 18:35:58 -0800 Message-Id: <20211113023559.212793-2-hj.tedd.an@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211113023559.212793-1-hj.tedd.an@gmail.com> References: <20211113023559.212793-1-hj.tedd.an@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Tedd Ho-Jeong An This patch fixes the uninitiailzed varialble(CWE-457) reported by the Coverity scan. --- monitor/rfcomm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c index 41533b158..02300a8b5 100644 --- a/monitor/rfcomm.c +++ b/monitor/rfcomm.c @@ -437,6 +437,7 @@ void rfcomm_packet(const struct l2cap_frame *frame) if (frame->size < 4) goto fail; + memset(&hdr, 0, sizeof(hdr)); if (!l2cap_frame_get_u8(l2cap_frame, &hdr.address) || !l2cap_frame_get_u8(l2cap_frame, &hdr.control) || !l2cap_frame_get_u8(l2cap_frame, &length)) From patchwork Sat Nov 13 02:35:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tedd Ho-Jeong An X-Patchwork-Id: 12617529 X-Patchwork-Delegate: luiz.dentz@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95181C433FE for ; Sat, 13 Nov 2021 02:36:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 64FE760EE4 for ; Sat, 13 Nov 2021 02:36:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234920AbhKMCiz (ORCPT ); Fri, 12 Nov 2021 21:38:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234372AbhKMCiy (ORCPT ); Fri, 12 Nov 2021 21:38:54 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C34B2C061766 for ; Fri, 12 Nov 2021 18:36:02 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id gf14-20020a17090ac7ce00b001a7a2a0b5c3so8411892pjb.5 for ; Fri, 12 Nov 2021 18:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=THLf6o3JzTtzThS8U6PlEoELizBkSo+EEng61BaAMTI=; b=pTVw/xmqhCyb708C4KeiB3vRMwKhYpL8kPZ7Ov/JQ6zB88pVU2XyeiqTibRFGQi42t jZjQlklAtj6e2U2kzcf73xfjOduMr/Ctt/OrCjlqzUt1+y+NYwvSjyNxxDA8YsgwuJh9 WkC2OY1bMoYW+2Y8JsLOSGiFluHF+MAuNLacsWqlkB65bFBLnsUY09IJxj0iFcZYpiBP QSFYI7J0bXl9J8UZXiSae6TtIb0IJH+ofxWMsSRu3G4ual/rtlPBYNttPVyUkTZ0EIzh cdDDhvvuzL6nDkfiueKVIYS3jrS6YjSo3iSlaEndx/Vg7h7xG9HdeFzcSRGN6dchCg+F Z0Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=THLf6o3JzTtzThS8U6PlEoELizBkSo+EEng61BaAMTI=; b=OjRQZFw/wsN/F1hQkYSPPob9zfF0RQ8jPbdChW421QKGJs5u89wc3smf71v3XzyEE0 tMBYzh7pRmLFHGsfT54zvAC5m0C0h/ANUOEZ1iORhhm8wL37gmZYDk2VylDMhnpN+ygX ZKXWTYF35K5CgaHe5vMKOWelwUU7uM0Ss0Vl4KzgCOq8ErQkYj7vQK5rWgDjEAkLWe2V KR1fIi6Gk0jcqz1iZn7jPsLvPZp1PL/KuLtkdnTYWzCRX5Hnh2jayEtmNbsOvJm3Ah8T C2Ks4ZHZvsEu+jOLkszdLEqbybBSK0OVUOBvfNWNBYtJEuxwfaA/B/NZgYWYPyAcMGFK VS1Q== X-Gm-Message-State: AOAM5318vifdBWiSfEjprlcRGUl/bGTXsFxWmHcd5Kq4nNNEWgpdb0c6 YzO9aJ1hoPUfK/k0qWkeyrDqLhUbZKA= X-Google-Smtp-Source: ABdhPJyp0sUgk5BWb0UmcTul4Rh2TeX+PRJsHVRPIKvIYKtF4UWbHnvo/aKhcuQAvoC8Hw0K7GYunQ== X-Received: by 2002:a17:90b:17cf:: with SMTP id me15mr22998856pjb.125.1636770962128; Fri, 12 Nov 2021 18:36:02 -0800 (PST) Received: from han1-NUC8i7BEH.hsd1.or.comcast.net ([2601:1c0:6a01:d830:5c5a:3570:def6:e3d5]) by smtp.gmail.com with ESMTPSA id co4sm12006768pjb.2.2021.11.12.18.36.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 18:36:01 -0800 (PST) From: Tedd Ho-Jeong An To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH 3/3] client: Fix uninitiailzed scalar variable Date: Fri, 12 Nov 2021 18:35:59 -0800 Message-Id: <20211113023559.212793-3-hj.tedd.an@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211113023559.212793-1-hj.tedd.an@gmail.com> References: <20211113023559.212793-1-hj.tedd.an@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Tedd Ho-Jeong An This patch fixes the uninitiailzed varialble(CWE-457) reported by the Coverity scan. --- client/gatt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/gatt.c b/client/gatt.c index ce13b3341..9c991c2ac 100644 --- a/client/gatt.c +++ b/client/gatt.c @@ -175,6 +175,7 @@ static void print_service_proxy(GDBusProxy *proxy, const char *description) dbus_message_iter_get_basic(&iter, &primary); + memset(&service, 0, sizeof(service)); service.path = (char *) g_dbus_proxy_get_path(proxy); service.uuid = (char *) uuid; service.primary = primary; @@ -257,6 +258,7 @@ static void print_characteristic(GDBusProxy *proxy, const char *description) dbus_message_iter_get_basic(&iter, &uuid); + memset(&chrc, 0, sizeof(chrc)); chrc.path = (char *) g_dbus_proxy_get_path(proxy); chrc.uuid = (char *) uuid; @@ -350,6 +352,7 @@ static void print_descriptor(GDBusProxy *proxy, const char *description) dbus_message_iter_get_basic(&iter, &uuid); + memset(&desc, 0, sizeof(desc)); desc.path = (char *) g_dbus_proxy_get_path(proxy); desc.uuid = (char *) uuid;