Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp912678rdg; Fri, 13 Oct 2023 05:12:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwMhZt4jLg+fyAIFC4al4ToTs/VyiQp1oLsl2dFt3k/9GRVO2b0tHVZSxwWGF2i7L19Xuu X-Received: by 2002:a17:903:124b:b0:1c8:791c:d78b with SMTP id u11-20020a170903124b00b001c8791cd78bmr30835704plh.29.1697199177022; Fri, 13 Oct 2023 05:12:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697199177; cv=none; d=google.com; s=arc-20160816; b=fC+C2Eh2fjPCkA3MkgTEGrHZ85zucdSgZ0+GA2wJME/D9fTq2wMUcif+2SPMP9Ny/V V8P6O63yFNpgpWtgFIAP+V1YiDIa7tnyeGgbe7maWgpCjPKetdn0djBTs2vyHBUML2zl +vMePZ9yppKTOu0/3t0D/NqlNHOXvh28IZcrM5WXJeZgNtsea8H1aR/NSJtZKzelYb/a FnK+Xn4P4LFYvkD4csCKH8Vqz0qEsu5VfgIqC6u3r21SRbmL17ynhq7AIChaOxKKiRYW JikMEom8E5Fe0wLykDFK2jPJlyfEWEdndmAPbOm50jyjUsHNFAEQzKjlfWjV6aDLfEA1 BQdA== 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=ommulkgo6kT/ecNae2/W+LpZutQGK9Ntv8cEwiwSQYM=; fh=cOckVxVjrM5jmf86/i5eTTw5wBLyeTzAmcCgKIUtB0I=; b=jYzZt42DiKe7Gakl6fnYZbo+6zqht9AKqXp7UL3Z3WkgwtxJDbqy2koolT4Jt2Y6dT M1HgDfeO7kvy4y+k3Ilo90I2oW/IdjHwXD7riolNj8FGLaXe4+efqnnODqxA/ap1k4J5 SDj5PNgJO+p/axcd8r+uNW5SviL5smTI/XuMWf6ecjd9pvYR1SueOFCSyH5RI78ZDoi0 s+czoq9u9VdhcrqEpEzPsPNM9T9d8UQLlB+SeRFo9/qRVvXJdD1rcz1H0LhiyFhPkpAu uVlB1XJd5u2QJiuOXZnYWbRpZFuyN90LfVDtXSSNusJ/W0jFVjJ6S/UoQy4wa/paHep9 +Jpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RRFPZhZb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d17-20020a170902c19100b001bdcd2e1706si2446934pld.196.2023.10.13.05.12.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 05:12:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RRFPZhZb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 1C4E78311BE4; Fri, 13 Oct 2023 05:12:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231381AbjJMMMv (ORCPT + 99 others); Fri, 13 Oct 2023 08:12:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbjJMMMu (ORCPT ); Fri, 13 Oct 2023 08:12:50 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22AECBD for ; Fri, 13 Oct 2023 05:12:49 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40666aa674fso21005965e9.0 for ; Fri, 13 Oct 2023 05:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697199167; x=1697803967; 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=ommulkgo6kT/ecNae2/W+LpZutQGK9Ntv8cEwiwSQYM=; b=RRFPZhZbzewTHqk0XPKeBXIwUGC+ATX6lo2EsRxrr0MTYWYoLFHQN+kedsfWVE82d6 iX5iQ0883Phfy5u/Ax3e5hrV+GsQeqRYpAWIgedF6q8qEr5zKnhVpcevXX8nsA+z7OyD lmkQmGLwOFT1hXzG2VQJJt46hghaxue/UgY4JIH2evrlSKVhTPPyk8UiX26IQdugz+iW WAwV05mW2feKnt9hVdkeO5D26z51GxCd5LfuZvRnVmi7lJ3sPPD0baKSfLOsFNouLlTa zwlkmqmgcLP8QbKCwRQfEq3auw3Vf2VIjl8MG6VsY7UkU1OqM1wfAhAzqNsbzuTaCgMb tr1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697199167; x=1697803967; 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=ommulkgo6kT/ecNae2/W+LpZutQGK9Ntv8cEwiwSQYM=; b=hSWVX1lw7qIBA7BXt1wPBuX7+t9fBZVW0B+dgoMBlVfchTgYkt6jCSp+JxBNMU4n7E CJw3vgEOTC8ed90zjdb9joPG5XYZWff+OnUYLIDIp69HrdnulTNABtDhUDt8FhNwauzM yMWf8oRJacVN9Y7RPJnMCG5wGv569lbpYT85b4rvk7s5rwhlRbGqg7Iw8q/jxQZ3aIk5 7TQFSKkDsRhtCiTOi/NdECqBaP0fITrFNxWyJJrGmy6cC2vCJKW0BCUOSSQKAokpmH7U xMCirryq0N2tOldSmCCDn1xBlxEl38/NoR+CunH+98bLGWzDrNh+Zplu8pnDHGW6rMJ9 +6Dg== X-Gm-Message-State: AOJu0YyLaVFMQf7xk5MOIe7tmedgBEOHWc8kUR1wmsN8EXmqiWtVryN1 K1MUJ6ClILTKQf4YYRhRKBn6XrRPT0cGzv4AAm4= X-Received: by 2002:a05:600c:2146:b0:401:daf2:2735 with SMTP id v6-20020a05600c214600b00401daf22735mr22563494wml.31.1697199167422; Fri, 13 Oct 2023 05:12:47 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id n8-20020a7bcbc8000000b00405c7591b09sm2399240wmi.35.2023.10.13.05.12.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 05:12:47 -0700 (PDT) Date: Fri, 13 Oct 2023 14:19:44 +0300 From: Dan Carpenter To: Calvince Otieno Cc: outreachy@lists.linux.dev, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Luke Koch , Bagas Sanjaya , Simon Horman , linux-staging@lists.linux.dev Subject: Re: [PATCH v6] staging: wlan-ng: replace strncpy() with strscpy() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS 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-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 13 Oct 2023 05:12:56 -0700 (PDT) On Fri, Oct 13, 2023 at 02:15:43PM +0300, Calvince Otieno wrote: > Checkpatch suggests the use of strscpy() instead of strncpy(). > The advantages are that it always adds a NUL terminator and it prevents > a read overflow if the src string is not properly terminated. One > potential disadvantage is that it doesn't zero pad the string like > strncpy() does. > In this code, strscpy() and strncpy() are equivalent and it does not > affect runtime behavior. The string is zeroed on the line before > using memset(). The resulting string was always NUL terminated and > PRISM2_USB_FWFILE is string literal "prism2_ru.fw" so it's NUL > terminated. > However, even though using strscpy() does not fix any bugs, it's > still nicer and makes checkpatch happy. > > Signed-off-by: Calvince Otieno > --- It's still white space damaged and can't apply. :/ Try save the email and do `cat raw_email.txt | patch -p1`. regards, dan carpenter