Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp202043rdg; Thu, 12 Oct 2023 03:15:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcmlcpZNE/4q4YK5QWRM0EYM/hp6mpQGb50TK/M83kq1y1Tx45PcuVXeQObVKu3fsf5tud X-Received: by 2002:a17:903:2352:b0:1b8:8682:62fb with SMTP id c18-20020a170903235200b001b8868262fbmr32122735plh.4.1697105736138; Thu, 12 Oct 2023 03:15:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697105736; cv=none; d=google.com; s=arc-20160816; b=Ptu9bUY64l359dxbsWnZZ0i+qNfSQJ8oJS18qr3yQauKXUIK5iXP98IKOEml5sU93x GEMuRWvv570NYS9vc14y1SWOMvXNl6Tj/5YTfU5liD/1WVcpeBhW5eJOArHJ6uZLBIHo OHLqOVv0+1eOa0dzrIB5djuoBHjVyHcNRH7piB7r8vcFL7YGsvlk07d2VGBY3lL6RIeh wpSG/ubRCWFLuiyqGiiYon51pe+o772b+EUgm88ZhPM/fBQ5gH5jB367EAMByaxJx9m4 g4EgmDEtgugcZya3Z7VFg1VaYC7EnCYG7W3S7/30C/jpHy+bppwf4Ey1medt6mqhArC8 uRsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nGBRtscR5XFDxdOEvFyr/E+oy+5VNzI6usKYmeqNS50=; fh=7Shfn2xndWHI1JmWFgc4HTXwHCBPgwVBuohIp9ZfqpQ=; b=MmQW8zBUAnrcc+2Tdlzj4jor8LG3z5eoMU6A3x2SOaEGNp/W/+I6ROX2jXNVPyPVGW rtsGTyLEw2i5mV8Ecuiv/uSOSnyOGraTQ9IJqgZPXgmT94xtfd0y/WikFtJx+Etf3H+f hqqA+3oLhnTmGBlhJ5d3vffje6I8PUg0aySp9m7Fv9qQuDGWPiS0zDIkV9RCcCLhLd2S QrjmWmEaSmOA3HVpLtZ+ISBZrzoOzLKPlFs2yviibi68aLXXIVbH1U79I86317knShNV 3V2ccuPugNhw7WrocybqutWllu/QcECmOlPTRgBwg2sKlHvk57mGbcnj/Z1HEM1zIJ/Q kdNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MiD8CQme; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id fh25-20020a056a00391900b0068fe810e8a0si14440221pfb.197.2023.10.12.03.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 03:15:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MiD8CQme; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9AD49807C741; Thu, 12 Oct 2023 03:15:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347116AbjJLKPN (ORCPT + 99 others); Thu, 12 Oct 2023 06:15:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347104AbjJLKPL (ORCPT ); Thu, 12 Oct 2023 06:15:11 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C1CEB8 for ; Thu, 12 Oct 2023 03:15:09 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-32d8c2c6dfdso758777f8f.1 for ; Thu, 12 Oct 2023 03:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697105708; x=1697710508; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nGBRtscR5XFDxdOEvFyr/E+oy+5VNzI6usKYmeqNS50=; b=MiD8CQmeMKyPEpIgMLAsKr0oRB3e2v7zP/g8r3qA/0QN84vgCuNUSCwx4pvG/81LK+ QrFauRZtZpMUeV4YHbV4oRE//xcM90Q9oEN6UdAna6P/OozwYylbZS6mVKY+h6daLx63 mw2ftAaozJ8dBF8Zly+53CK6A1rIvMq4YXQmQlqUAGXv3fKhEKXgUCOSUPO7CllQd4h2 l1wGfVSYDZkc944/OvbDfElC4OkzB/K+ehdIMfNKKAhlCDpAFJjhOw4+MEkW9Ac3aJnd Cw8oQSrvbxA9/uGhvvom9MdzB7wVU7pBoivOJ9uc9gJ5ViDgQWVgW5uZJrHDFMRmmICx XPDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697105708; x=1697710508; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nGBRtscR5XFDxdOEvFyr/E+oy+5VNzI6usKYmeqNS50=; b=eiEJSIcxqzikAX0H2sLuPE7uBtBj/82+oIgdwHwb213C/SyWSS8PQfwRFsZbnLfWPz +2QBlYoHwGgDbu/3cKCz1pmacS3MX6jKs0en71OzzG6TVyAi0Iu+4L/20sMTPPFJ4yGp IxLKrfCRDO4yvgiKo8DlaMWfUdnLXTWUvZzm9r++LyJryDlXMvri21QWXBBPKRIwHqvo 1fGxArbLMFGz5Oh1997ISTUzXofwGV9Gg4wD7GEudgb5RBVK2DvSNKbI/Qod/xhN7cxU 93JFioM/QU0FkMqwDXt6R+/gsjYwzC1H7U7frmXX7XNlyL9X1K6L+xaOi8XLWYh9/EXA LiaQ== X-Gm-Message-State: AOJu0Yw4g8pFBKTDlL4yGxH3nRnbLk3pjOLMLYtlWwF0eMl6XK9eRwHI cer2L/hk3HALH98rA+h1NcV3Mg== X-Received: by 2002:adf:dd82:0:b0:324:84bc:d59e with SMTP id x2-20020adfdd82000000b0032484bcd59emr19004327wrl.22.1697105708075; Thu, 12 Oct 2023 03:15:08 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id ba18-20020a0560001c1200b0032d8a4b637bsm2981997wrb.22.2023.10.12.03.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 03:15:07 -0700 (PDT) Date: Thu, 12 Oct 2023 13:15:04 +0300 From: Dan Carpenter To: Calvince Otieno Cc: outreachy@lists.linux.dev, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Dan Carpenter , Archana , Bagas Sanjaya , Simon Horman , linux-staging@lists.linux.dev Subject: Re: [PATCH] staging/wlan-ng: remove strcpy() use in favor of strscpy() Message-ID: <848becd6-9f65-4316-a2f0-ebf2ed2f5758@kadam.mountain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 12 Oct 2023 03:15:33 -0700 (PDT) On Thu, Oct 12, 2023 at 01:03:40PM +0300, Dan Carpenter wrote: > The simplest approach is to do a: > > git grep strscpy | grep " - 1" > > But the better approach would be to write a Smatch or Coverity check to > prevent these in the future. I meant Coccinelle not Coverity. Duh... Also btw, sometimes we want to keep the "don't necessarily terminate the string behavior". That's rare and ugly, but it does exist. regards, dan carpenter