Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751666AbaJRWMp (ORCPT ); Sat, 18 Oct 2014 18:12:45 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:57729 "EHLO mail-la0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751621AbaJRWMo (ORCPT ); Sat, 18 Oct 2014 18:12:44 -0400 From: Rickard Strandqvist To: Michal Januszewski , Jean-Christophe Plagniol-Villard Cc: Rickard Strandqvist , Andi Kleen , Andrew Morton , Dan Carpenter , Grant Likely , Tomi Valkeinen , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] video: fbdev: uvesafb.c: Cleaning up missing null-terminate by switching from strncpy to strzcpy Date: Sun, 19 Oct 2014 00:14:56 +0200 Message-Id: <1413670496-6387-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 Ensures that the string is null-terminate in connection with the use of strncpy, by switching from strncpy to strzcpy. Signed-off-by: Rickard Strandqvist --- drivers/video/fbdev/uvesafb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c index 509d452..3383b34 100644 --- a/drivers/video/fbdev/uvesafb.c +++ b/drivers/video/fbdev/uvesafb.c @@ -1892,7 +1892,7 @@ static ssize_t show_v86d(struct device_driver *dev, char *buf) static ssize_t store_v86d(struct device_driver *dev, const char *buf, size_t count) { - strncpy(v86d_path, buf, PATH_MAX); + strzcpy(v86d_path, buf, sizeof(v86d_path)); return count; } -- 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/