From patchwork Sat Oct 18 22:14:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 5100341 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8FD25C11AC for ; Sat, 18 Oct 2014 22:12:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A0AB2017D for ; Sat, 18 Oct 2014 22:12:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A106720176 for ; Sat, 18 Oct 2014 22:12:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751633AbaJRWMo (ORCPT ); Sat, 18 Oct 2014 18:12:44 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:47320 "EHLO mail-lb0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751622AbaJRWMo (ORCPT ); Sat, 18 Oct 2014 18:12:44 -0400 Received: by mail-lb0-f171.google.com with SMTP id z12so2260980lbi.16 for ; Sat, 18 Oct 2014 15:12:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PxaZJvkDVqk/G3rZw51ZakuayYSl60ABQhYd7/dNa6A=; b=Nv0UctuCOyoXgvfKxzgi2y2GEFwksEhsRuVAz55jEENO9w3oXZCaWixK8XOdER6nhU q9SpqXCeMKUCfvZBxh60jvjdys5syPOZ6n2ojHhI4EcizHNiVhPPVz3HHG4iMcDXShhK 8WoOoQIe5yi/JG90TD1kMstiVW47c5fSHAlpkJ+/zLzoHRB94DHax9DL9f3Howu47eWr 57mpDEoq5BboJecHUHxfRZWtbQtgkJ8IfIGGXqvU2O0eC0cSDmYW8mbjyj/FJORxStyj ASd97k/uU9jXI3lF7bIVxdBv21SF5vX79WdXsLIOkcpiF6jzZrMp3hj2AtRLqb85z/fZ 53nw== X-Gm-Message-State: ALoCoQmbyIXiXhnwXwUZf+hMDzSMaw5VFOTGvw3EC7MuZJX9dsl/UyQATgvjkApzPNFc/LlUBnRQ X-Received: by 10.112.140.8 with SMTP id rc8mr17220741lbb.2.1413670362800; Sat, 18 Oct 2014 15:12:42 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id r1sm1667251lae.25.2014.10.18.15.12.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Oct 2014 15:12:42 -0700 (PDT) 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-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }