From patchwork Sun Sep 14 17:35:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 4901991 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 A5FE7BEEA5 for ; Sun, 14 Sep 2014 17:34:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D711B20170 for ; Sun, 14 Sep 2014 17:34:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 203A620138 for ; Sun, 14 Sep 2014 17:34:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752821AbaINRd7 (ORCPT ); Sun, 14 Sep 2014 13:33:59 -0400 Received: from mail-la0-f51.google.com ([209.85.215.51]:38118 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752817AbaINRd6 (ORCPT ); Sun, 14 Sep 2014 13:33:58 -0400 Received: by mail-la0-f51.google.com with SMTP id gi9so3370583lab.24 for ; Sun, 14 Sep 2014 10:33:57 -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=/25wSHXwJ6xngEfsJhwrobi/g/oWz/wE3ANpDJt+PcE=; b=Wev9N5QOSTZwk1ouoFuULTRJFZXLBDCihtiCr5DK98ygr+fuixc8h+bUqF6wWeed/c +iPhcekPd+wdFXoI9d6o4q5qfSwrn6hMwuUXhdSRHxLisnniw54ESFjqdIt9F9MFASaq ozL+lkRAO7UHpl6ItVSXbbwpZxW6w5RZVnJuEKa7KOd0j3jBilyNnZ1SuBnBBT5ngU7p 33LnBEhyJfElkK/jVm8sc+mONvevS3HYFseZlfSpiQn/MwQ2zd9X5GjpkY33gPls/v74 3EPIWPUpKwiuKXMKD4zwqYeSQ4ipr4we4y4XNXUQOqWZA4x7vZpf93LrS3YxGOK5gYLB YZfQ== X-Gm-Message-State: ALoCoQn1oprR33p+WRW/6eOhKNSluTU+yhMfQUFHuLxledQKsRaoZlMUxJn3liWpZNGacfjen3+j X-Received: by 10.152.18.199 with SMTP id y7mr23251913lad.0.1410716037478; Sun, 14 Sep 2014 10:33:57 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id s6sm78726lae.33.2014.09.14.10.33.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Sep 2014 10:33:56 -0700 (PDT) From: Rickard Strandqvist To: Thomas Winischhofer , Jean-Christophe Plagniol-Villard Cc: Rickard Strandqvist , Tomi Valkeinen , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] video: fbdev: sis: sis_main.c: Cleaning up missing null-terminate in conjunction with strncpy Date: Sun, 14 Sep 2014 19:35:48 +0200 Message-Id: <1410716148-16243-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=-7.5 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 Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist --- drivers/video/fbdev/sis/sis_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c index 3f12a2d..1f4c216 100644 --- a/drivers/video/fbdev/sis/sis_main.c +++ b/drivers/video/fbdev/sis/sis_main.c @@ -5830,7 +5830,7 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ivideo->cardnumber++; } - strncpy(ivideo->myid, chipinfo->chip_name, 30); + strlcpy(ivideo->myid, chipinfo->chip_name, sizeof(ivideo->myid)); ivideo->warncount = 0; ivideo->chip_id = pdev->device;