Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1339386rwr; Thu, 27 Apr 2023 16:29:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ54EJSORyFnshEgHLBZMXrkI3dJWSals938bQ8zfaxF+3EwzrNeb2KWvYfZDbeAEY0urRcJ X-Received: by 2002:a05:6a00:22ca:b0:63b:5c82:e21a with SMTP id f10-20020a056a0022ca00b0063b5c82e21amr5303681pfj.1.1682638198455; Thu, 27 Apr 2023 16:29:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682638198; cv=none; d=google.com; s=arc-20160816; b=W+w5T7SPJ5+3orTGeIcU4nf+d/HkUt6r2QZa5NTMZDB9NCHxgrH2d4eZBET2d9X71o 9O8+99X6kV7QbfeoNWPy8DhdcfXH6yZLo+EaGsKzORCv/Onl7qP0GjhKnnBzAoZYth9A b1dVNgOL59eIOc/w93vs8Ri3YCnBQ8rOVD1Ft6iNM/C0lmGR4JHU81TDVu71CzGOEfog 00DBS3rnctxo91fJdtY28prEF4zB7nYE2WiJMv8bgyrG/94hD8tbSN5BWBuXW8ETf2F1 BO01rxcvxUgfkZ4NDx1z0f2DPcMPGz/szbGeSbwCgaGy/wTVcU8sl4GCqLuolGE2URqb dR4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=1Zf1jMK3UJ9SfKs4kbWstHqgU/7a87nWIjklSePkN28=; b=i4CddFd7XXiuHgQl4lXBFfNviKi9CB+RMMANxYQgCTn/aioH0iZ2Wh+TJZex+ZRp+t bwklCWbTMf61mvgLoqBQVMnynF/4pPsDnNq6bxgKOkkHozbliLpx8Vqymnn0fm2hKaJy LPMNp9mXlTRD8c0AoKG/ZUT22heZvzobIhAXmgBUwLRtezCF9EHtktPxtzgk3BDIGTQs OBzOinLphL9I0bfC/Ryxk+ISeU3ewTUDHyAyIiGKEGCdgkgFZk6I8Cy+jB78kdhXs/io qlhiO0/Hx3mK7sRo4tjKzboEc7aFyRJtgN3mQfwN7ECATteF0f7ckN7+oWlDm169+OnG TCtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=OnNo1Q6Y; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m125-20020a625883000000b006361df3aa86si11018909pfb.88.2023.04.27.16.29.43; Thu, 27 Apr 2023 16:29:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=OnNo1Q6Y; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344404AbjD0XOQ (ORCPT + 99 others); Thu, 27 Apr 2023 19:14:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344407AbjD0XOP (ORCPT ); Thu, 27 Apr 2023 19:14:15 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF51644A0 for ; Thu, 27 Apr 2023 16:14:09 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1a68f2345c5so71048335ad.2 for ; Thu, 27 Apr 2023 16:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682637248; x=1685229248; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=1Zf1jMK3UJ9SfKs4kbWstHqgU/7a87nWIjklSePkN28=; b=OnNo1Q6YWVxmFrmHu28/csR4ckusSUBOsDEQaptHZ9juM5tmM4z7m+sco6tvYD121W Oq2xQe+y9VsKcYlg6M2laEq/EBmjaklRegJdWOe5rd5GpH6etPLfbxUBOpxqggqUHSVS niGPwfYd7Z232ztFE960DWFEhJd6bWfE2joeXSvX2WXT2+pQkUiNhsHkR4SJF4ayq0zA DFM+6ejxA7+JCxUdn0ax7RcDK8mBuBDEqbfvFFxGwx73m65Bi9wid72DVngnf32Qop7u Y/yfaUvL2SaFwixhLs5BzN+F1D6ajPW4DPmrcUGYXVlLc/BsVAo+1+EfBITFEXTXSa69 LR1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682637248; x=1685229248; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Zf1jMK3UJ9SfKs4kbWstHqgU/7a87nWIjklSePkN28=; b=ACjoFemux/MWkZIDNfzP7XwPzShXI3vCmBuChIOJYJtWAzCPQQKdpDjJ5EKAUVAjMf AcJZMyvtzCxv4t3G6UhXVZwuN+PpQSN5c5dhoaoYkNr0oheLlFH8I1x8XpvnqzrhOiQw GL6GesVvsOgTv0tK0dgwDHpRZGTK6U/ptW4iKe8Wf2tRmOxYpdTAMfGzjihr0mcrZbgr WgJwcDPFaAQ81EH/mOvWMtp6vXzpWHwxdNnjlB7oGPckn4iTwtDakDWcdgOBQnqMXfi5 bW6MxpzGYNjbCwremzQdIA6/UGYVQ9xnseOMnj5v4Y9tHBXzRIWAsNm272TQB1HMt/CA zjOA== X-Gm-Message-State: AC+VfDzMHPOqtPoEwAKq038YdOHsI8IB3hUgmV4tTNolYjIkyN60rJNl yFL7Inl/PT7lAIptZN/nF1B5d/eI1zs= X-Received: by 2002:a17:902:b10b:b0:1a6:983d:a1ec with SMTP id q11-20020a170902b10b00b001a6983da1ecmr2857099plr.26.1682637248370; Thu, 27 Apr 2023 16:14:08 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-59-129-171.hsd1.or.comcast.net. [71.59.129.171]) by smtp.gmail.com with ESMTPSA id c5-20020a170902aa4500b001a24cded097sm12112369plr.236.2023.04.27.16.14.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 16:14:06 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH v3 8/9] shared/util: Fix runtime error Date: Thu, 27 Apr 2023 16:13:51 -0700 Message-Id: <20230427231352.576337-8-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230427231352.576337-1-luiz.dentz@gmail.com> References: <20230427231352.576337-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This fixes the following errors: src/shared/util.c:271:2: runtime error: null pointer passed as argument 2, which is declared to never be null --- src/shared/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/util.c b/src/shared/util.c index d31daacc4b93..9a4a8d77abce 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -268,7 +268,8 @@ void *util_iov_push_mem(struct iovec *iov, size_t len, const void *data) if (!p) return NULL; - memcpy(p, data, len); + if (data) + memcpy(p, data, len); return p; } -- 2.40.0