Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10799032imu; Thu, 6 Dec 2018 07:01:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/XUyQf4rn3+Z+alcKSB9fGMvlill/PoyiQDpT8RCONTJ7qzNw9JIKriN9T/iCyNYwiOhiVN X-Received: by 2002:a62:6ec8:: with SMTP id j191mr28815768pfc.198.1544108472650; Thu, 06 Dec 2018 07:01:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544108472; cv=none; d=google.com; s=arc-20160816; b=DRQRNrRplbe4XDfFHY4BSnQEFHHCGq10qNRYcK6OPI+sAmmV7okZhxvR3Rrg30WCuI hK/JiqZfa0QS/GbQ/FwB50RPY6PEjUjsHRv3FwkXcRH2nDqvPSP/238jwIyxzXTW+9+k PpVz99DYsaBV9dMsHsa8981Kps8TF/uU+7tGip0z+zW0/3d90Nr1dj9E7vCb2p9J9bnX 7Y/PcMyc0qVGNC+wzeOIttGMoJ6lDtEs0F8z+xWiS5zz0xiNn5MyT5jqCzp0MCa1uioE 5eXOCevrpm0Xx+6hHTWDv6QyIdClVHGvXe2tuADc579Cx1kWP/dgy9J53+SKUZCVcy0C CTbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=N/fq2xYZg6yayRHVap02vewEOJJfCFVXMS2bLzzObGA=; b=m/+aS1uwqVPRfQvDOKDYkSxGYpB2yDWXRVjNvAOytHIZz2x8ytp3L7D15u6WdSLpTy SA+UyI0k4mjQN6NytG2h0fzgaxnUmWfSCyONuQiBTubk3WXeInO+JLbfALYxuPN4D8dG Momz2QywDJEdjDNNsWBGTBFF0XBRP9An0RVDvNreYtlfKNV4R17FoanYqCZdsH1jHMGn 1pdQroQDHlA4rJxRJO9XtWHh04WlpzUi3QxMfXEsZkTdFcZBuPPxMTjSXLnLMg1e+eTs dy4AbBOVpiWuFTHlNieAIEfRWW4LQdVNlMFxsok66B2BJNG0V+YjNLz1yL96gnc3DQ76 TGqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kQCx8gPo; 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 e63si397461pgc.239.2018.12.06.07.00.55; Thu, 06 Dec 2018 07:01:12 -0800 (PST) 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=@kernel.org header.s=default header.b=kQCx8gPo; 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 S1730388AbeLFOmE (ORCPT + 99 others); Thu, 6 Dec 2018 09:42:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:46360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728482AbeLFOmD (ORCPT ); Thu, 6 Dec 2018 09:42:03 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6892B20892; Thu, 6 Dec 2018 14:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544107322; bh=eiKeFqhTYnN8UM5oVt26eBXuZb4ygNkKKZUlp2oYhO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kQCx8gPowKZkNv5898goR0t72GqIUnSYGzvR6LOdlFsEco1RZSmBny3hz4cR3Enl5 tzJlgltcFoZx4xp8v8kxWUiqh+9oxPxIyc8KA9WfmpeArLBvwxrxuE/d+q0cMKGsK/ 0ZZljyregDGjJ1tEP9u7eKatVlkWUZYBkyCipi4Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Torvalds Subject: [PATCH 4.14 03/55] test_hexdump: use memcpy instead of strncpy Date: Thu, 6 Dec 2018 15:38:37 +0100 Message-Id: <20181206143001.933529895@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181206143001.749982936@linuxfoundation.org> References: <20181206143001.749982936@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linus Torvalds commit b1286ed7158e9b62787508066283ab0b8850b518 upstream. New versions of gcc reasonably warn about the odd pattern of strncpy(p, q, strlen(q)); which really doesn't make sense: the strncpy() ends up being just a slow and odd way to write memcpy() in this case. Apparently there was a patch for this floating around earlier, but it got lost. Acked-again-by: Andy Shevchenko Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- lib/test_hexdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/lib/test_hexdump.c +++ b/lib/test_hexdump.c @@ -81,7 +81,7 @@ static void __init test_hexdump_prepare_ const char *q = *result++; size_t amount = strlen(q); - strncpy(p, q, amount); + memcpy(p, q, amount); p += amount; *p++ = ' ';