Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1440543ybe; Wed, 11 Sep 2019 15:15:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlH350ONUhv7PPYQU0ea2A8i2wmeXYwbkvRAOYWtbuQeTGT8r6F43C910oSHgC+01xnw5/ X-Received: by 2002:a50:9eee:: with SMTP id a101mr16400316edf.128.1568240115903; Wed, 11 Sep 2019 15:15:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568240115; cv=none; d=google.com; s=arc-20160816; b=qpmKlZRDGmu2vMTQ4pXQPj+YKy6RIUq2wnM8yAkFigshWh+IP/IT5eByt+bKxkjuM2 rM+vk3sFZAzBYhiJIyS/RNvSa/PaTJuUZkjGbSPp4ABC0Ejz8PI3C7JtEzTbwATNUIKY 2WkJhV7bgk7iT2SyzsBbGYVEwjPoRdO0QcB2ueouyd43WnUuZw6L7GaBH5RcuX8yaKFs AqaFneNCJF+JDA7Pr0BS1FAmmBmjYKkeaIrTU03EZiwJ+FFUs9zlQi3Uy0/g6ds6O5s0 DuAE2ChH9NIY2BDh8F3+yfsqVo7B2pHi2em2AeWeelptbDK+V56Diwdbbs5c+msfsFHX JJ7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding; bh=aesEhbPP4rQYcN4oUqEgpp2RB2nOJZ4cS8OXukBE3KA=; b=ChcNh/yE7RWjhS1RK82E/U5unLXEPy608sF8o/czR8bnP3vXpuSqnXktkmrnLPKNy8 4Btbe5bjCSe8w44E/rkPkYOUPMlrLJlZExaSNfNxMt7cwVf+E4ayrjET1LoletT/n4ws 7eVNjBcH6RASXrhQn6vLJU+XNLMfxGMpLFRIok0IsOoy4GH6QhWu6d560iNhbR8Kv2iq gEJvs0GcvsCUigTP+Py76S7sRrXQEmjHMRDjbU5xEc7ha7D6nlkfBdKBuukoeRHDL2NK Vs/MCBXKeQrDTE0diLagiRFZhTzqnqhIwl0Elg/3+pHKJIHjRDAzQujcgp3Q4nnfV+xb KSgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g38si13180239edg.127.2019.09.11.15.14.51; Wed, 11 Sep 2019 15:15:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730278AbfIKTQ1 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 11 Sep 2019 15:16:27 -0400 Received: from mxout012.mail.hostpoint.ch ([217.26.49.172]:48777 "EHLO mxout012.mail.hostpoint.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728600AbfIKTQ1 (ORCPT ); Wed, 11 Sep 2019 15:16:27 -0400 Received: from [10.0.2.46] (helo=asmtp013.mail.hostpoint.ch) by mxout012.mail.hostpoint.ch with esmtp (Exim 4.92.2 (FreeBSD)) (envelope-from ) id 1i886I-0005Wf-Ge; Wed, 11 Sep 2019 21:16:22 +0200 Received: from [213.55.220.183] (helo=[100.66.136.169]) by asmtp013.mail.hostpoint.ch with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2 (FreeBSD)) (envelope-from ) id 1i886I-000Nta-AY; Wed, 11 Sep 2019 21:16:22 +0200 X-Authenticated-Sender-Id: sandro@volery.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT From: Sandro Volery Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v4] Staging: exfat: avoid use of strcpy Date: Wed, 11 Sep 2019 21:16:21 +0200 Message-Id: <27939F0F-4406-4CAE-9D88-CFDA58A76BA1@volery.com> References: <20190911190355.GA18977@kadam> Cc: valdis.kletnieks@vt.edu, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux@rasmusvillemoes.dk In-Reply-To: <20190911190355.GA18977@kadam> To: Dan Carpenter X-Mailer: iPhone Mail (17A5831c) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 11 Sep 2019, at 21:06, Dan Carpenter wrote: > > On Wed, Sep 11, 2019 at 09:53:03PM +0200, Sandro Volery wrote: >> diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c >> index da8c58149c35..4336fee444ce 100644 >> --- a/drivers/staging/exfat/exfat_core.c >> +++ b/drivers/staging/exfat/exfat_core.c >> @@ -2960,18 +2960,15 @@ s32 resolve_path(struct inode *inode, char *path, struct chain_t *p_dir, >> struct super_block *sb = inode->i_sb; >> struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); >> struct file_id_t *fid = &(EXFAT_I(inode)->fid); >> - >> - if (strlen(path) >= (MAX_NAME_LENGTH * MAX_CHARSET_SIZE)) >> + > > You have added a tab here. > >> + if (strscpy(name_buf, path, sizeof(name_buf)) < 0) >> return FFS_INVALIDPATH; >> >> - strcpy(name_buf, path); >> - >> nls_cstring_to_uniname(sb, p_uniname, name_buf, &lossy); >> if (lossy) >> return FFS_INVALIDPATH; >> >> - fid->size = i_size_read(inode); >> - >> +fid->size = i_size_read(inode); > > And you accidentally deleted some white space here. > > I use vim, so I have it configured to highlight whitespace at the end of > a line. I don't remember how it's done now but I googled it for you. > https://vim.fandom.com/wiki/Highlight_unwanted_spaces Ugh I'm so sorry I make the most stupid mistakes today.. I was so sure this time I got it right! I'll fix it tomorrow. Thanks, Sandro V