Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3049149imm; Mon, 28 May 2018 23:22:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLIWFiGmOsK+kF1Yqq5UJmnszKaB36WhSZ7xyS7jH4htQbUkONxmgbWkpLASJdhSjCCKbsS X-Received: by 2002:a63:b405:: with SMTP id s5-v6mr3305943pgf.334.1527574963694; Mon, 28 May 2018 23:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527574963; cv=none; d=google.com; s=arc-20160816; b=q5oBVwuNJbc3tA1vywT59U9eJcE0Q+E2riYxLTuAgDKBDHY5zAHjr5Ob4TvZoE3t3O KvA96WtHtNfssKyrpvwaHQoWgfF00Rez4X79SAFwQeOQ3YYu8dAhFcXwWZuXjS7ZdzVG fZxsGW9KvgOS8zWCnp0m5il45wYZ/zWEKE2Nccsy0JmZjIB4Sm7V2hOe4R+WLsyOKCc6 /0SRW6BpQ0wtWmstacunjDjm3XLzYkTIqSPR2w4ZnncuDDDKcbfAuDpA+HU75fgN7aks W2ZOlK6yLHjmPnVEZ2pbZrjPuW49VnF4dzzHMp0K4lDNNdBD9B/KDVjU++u5R+0/n57f 0J4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=B1KMD9a/bfxsCilZpzbH1VPrBWHVNp+3bNPMXeNDGY8=; b=rGxVM87Wq9pvpI8T5ObMu9Td9tDJa0Aika07ok5vaTItzPLPibi7fvFic4tua8FSJ7 foa0Os6tCQQcpchU304fCe8KI530WWp9b4pAcnVLFggkOvP9Qo0fJKKfhYFttDdR1TST M7zwufCUKxPt6GoreIh/rjdyHVZglTY7DQtoDc7G1BIHkCyiWk0sF0quuIxMtiDfOXtl ol29IqTnqU4dtb2ggvN3bW2Of72DYCnKObQDlcp3sHtldyf9wpcPAQ4dHQP48jQesdfK kEq8r2vJw80SkFcPjv2h3xLTzPRMRdnfwi2O2JWUG7qcq9EAm47W46S1DtXl8lUD6Op3 ty6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hys5Skrt; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 13-v6si5100606pge.159.2018.05.28.23.22.29; Mon, 28 May 2018 23:22:43 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hys5Skrt; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754621AbeE2GWF (ORCPT + 99 others); Tue, 29 May 2018 02:22:05 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35232 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754205AbeE2GWC (ORCPT ); Tue, 29 May 2018 02:22:02 -0400 Received: by mail-pg0-f66.google.com with SMTP id 15-v6so5802784pge.2; Mon, 28 May 2018 23:22:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=B1KMD9a/bfxsCilZpzbH1VPrBWHVNp+3bNPMXeNDGY8=; b=hys5Skrta+kUxLP9AFbzgpY/wWRcddbkjgUVEo4Z/J7/X3bzdj3j+Qa4NN7oNAkpj+ NfsFAmnqNDVCjBq+pM8SKBGRi0yrvBuAxxgERqu5sxYnPzLqq+2UE9gCTwNy+z+MBxW7 4GD4LtqxZJ/iWhiodygPi4RbGG4mZ+nKo71vXJ69CYPyvvFBKUuQQlSS4eWl49r09rTZ V+j11rYqjOa5pytsq9/05Vf+0hKFXAregkFiG+dcYGP1N06ibneEUXLsKyzjNt8mWHEp h9d86sQN2PenE1/Pjw3UPw7tY/7bkdSE+VbLSHnawnSLdEPZeOfBDkWIZlXCqKIpWHIH 9sJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=B1KMD9a/bfxsCilZpzbH1VPrBWHVNp+3bNPMXeNDGY8=; b=V3kkrDOU8rGNy3yyRJIUVmRIqUKKVpndvo01d3CNPwDii5bff8AJyeDpacZwDzRKRX mLhzbUmnCw916StH1aW7aiuSEvnB3mAkjSbDuK7is+ubu65TDGI+wRB0no932Q0x9qKs rIj7xLf6a9WaGBvEsao3wnC7mhGMGWBINNVzas9AHKbXtnVNF6+5dQ+JhiTHcpb/P8bQ ztEjEcaitPblKhhLjpXcOkp2SOGR14dp+l0kSj4UZxN4W+FuodmzKZk4DWQ7rwP85jq9 JbHGZHEHlT4Kcpx8qNjVDE7ZYc1pxnkxSaK5+85mhSbz6bBQ/8iw0LrPCYR6h5dfHWxW a6Ww== X-Gm-Message-State: ALKqPwf0cjKfuBC/UfFYXvUYLD25GFif4CQXusPJp6BuCw16PJFPG/x7 fEY569tgbR/LOD5Gcf/FtD0= X-Received: by 2002:a63:56:: with SMTP id 83-v6mr12391325pga.29.1527574921295; Mon, 28 May 2018 23:22:01 -0700 (PDT) Received: from localhost.localdomain (c-24-6-183-110.hsd1.ca.comcast.net. [24.6.183.110]) by smtp.googlemail.com with ESMTPSA id u9-v6sm74412992pfj.10.2018.05.28.23.22.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 May 2018 23:22:00 -0700 (PDT) From: Nick Desaulniers To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: Nick Desaulniers , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ext4: prefer strlcpy to strncpy Date: Mon, 28 May 2018 23:21:53 -0700 Message-Id: <1527574913-10561-1-git-send-email-nick.desaulniers@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes a stringop-truncation warning from gcc-8. Signed-off-by: Nick Desaulniers --- fs/ext4/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index eb104e8..d47c85f 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -323,11 +323,11 @@ static void __save_error_info(struct super_block *sb, const char *func, return; es->s_state |= cpu_to_le16(EXT4_ERROR_FS); es->s_last_error_time = cpu_to_le32(get_seconds()); - strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func)); + strlcpy(es->s_last_error_func, func, sizeof(es->s_last_error_func)); es->s_last_error_line = cpu_to_le32(line); if (!es->s_first_error_time) { es->s_first_error_time = es->s_last_error_time; - strncpy(es->s_first_error_func, func, + strlcpy(es->s_first_error_func, func, sizeof(es->s_first_error_func)); es->s_first_error_line = cpu_to_le32(line); es->s_first_error_ino = es->s_last_error_ino; -- 2.7.4