Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10792454imu; Thu, 6 Dec 2018 06:54:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/WivAU0UBBxnhzGeez0S97TlnS3zQWGxHlt+MYfnTfENRch0rm35yaT8YE+X5/6yAQBsvOa X-Received: by 2002:a63:2a4a:: with SMTP id q71mr24185951pgq.374.1544108092343; Thu, 06 Dec 2018 06:54:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544108092; cv=none; d=google.com; s=arc-20160816; b=f2E6mr11VpCrwoojkf3TKwoWo6Q5efZBTvOPqtxo1pDE0/foeIy+8gTJd20h1Fe9CY nWqIK5MzrZpZ411NVO3OcEjOxJs4y2xtOU4B3xwFxgNahKdHLQgvH1Oc8Pwcxx3YSirl Zxkbuo9ILBTjZmhoVi5yK/mNSrRIC8XFWgc9UKt/+RAjPjtSHDcamUfMFmZOm73GMQQQ A1Ws4IC7y3KhwpJaAjiFN9ezOL1PmOXVzJR4RG6lwMLqLyzmQTShobbkKczlw1jCQnPF 0N5dfpUDBpcPMGoCrF2W09ANMwh4EaQ6WkRbMps3x5pYYLvOB4XPrCzlUi1nUxP8AOLd ugng== 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=wwZMrXODeTSFEDCeRccODAl5ZUqpBIfjX7KvcYW9GsY=; b=u5WtyGviJG8TfnAUHpgFeZU72JK8Y9khR9h1hGzkZyjWFtaY1AoEerkcnHW/RwC01m gdYURR+6BriBtatHOW1CxQDOHBMcYirTadhBUSeO+pJSrMJaDGhBg822jeEdETOL2tUk VEsP5ON0dBPqDBn+BTCdr33fg4vpLOt/SvIstho+F0s+89T9gl6HuWkCgsc5L5ZnaXZ5 3M7qCSY+uyyz3aukZtsOoJSyej+ig8MCyNdQxG6mZ9OlqrxIspj+KuA1/+68uA7QcOxQ 6BsyLBcQ4VsoGOb4QYgBHUf54bkU4O8kVe6uzZOwDlZqRxmumFqVQuQP+Ukhnq7Yc8zf 1ytw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PgPZcOFa; 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 o89si415689pfk.223.2018.12.06.06.54.36; Thu, 06 Dec 2018 06:54:52 -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=PgPZcOFa; 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 S1731009AbeLFOpL (ORCPT + 99 others); Thu, 6 Dec 2018 09:45:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:49782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730160AbeLFOpC (ORCPT ); Thu, 6 Dec 2018 09:45:02 -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 EC38A20661; Thu, 6 Dec 2018 14:45:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544107502; bh=fWpO+bwpj7kjPyCgUU7M1BPiWBp6at7NMi9AclcvQU4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PgPZcOFa/JEiX9zddhdzALWfKXFuN23LpZdBkyLJDYqxYXFV9j4zBDiyTenm9szuU b4zuCofhbVMFAciA7a/MBOe1aHI82PE7B2gVODTvVCc0xmCuEvbEyU2p/95L2+aU7g V8Yd18rIOLJLgpakLWt2L8aOUqrMAJlVY/cAifJc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Torvalds Subject: [PATCH 4.9 003/101] test_hexdump: use memcpy instead of strncpy Date: Thu, 6 Dec 2018 15:38:02 +0100 Message-Id: <20181206143011.815189571@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181206143011.174892052@linuxfoundation.org> References: <20181206143011.174892052@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.9-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++ = ' ';