Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751649AbaGZODP (ORCPT ); Sat, 26 Jul 2014 10:03:15 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:52176 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751158AbaGZODO (ORCPT ); Sat, 26 Jul 2014 10:03:14 -0400 From: Rickard Strandqvist To: Chris Metcalf , Wang Sheng-Hui Cc: Rickard Strandqvist , Daniel Walter , linux-kernel@vger.kernel.org Subject: [PATCH] arch: tile: kernel: setup.c: Cleaning up missing null-terminate in conjunction with strncpy Date: Sat, 26 Jul 2014 16:04:40 +0200 Message-Id: <1406383480-1485-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist --- arch/tile/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c index 112abab..1af7d19 100644 --- a/arch/tile/kernel/setup.c +++ b/arch/tile/kernel/setup.c @@ -1087,7 +1087,7 @@ static int __init setup_initramfs_file(char *str) { if (str == NULL) return -EINVAL; - strncpy(initramfs_file, str, sizeof(initramfs_file) - 1); + strlcpy(initramfs_file, str, sizeof(initramfs_file)); set_initramfs_file = 1; return 0; -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/