From patchwork Mon Aug 11 18:52: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: 4709351 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E6A789F319 for ; Mon, 11 Aug 2014 18:52:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30A292011E for ; Mon, 11 Aug 2014 18:52:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DCE02010B for ; Mon, 11 Aug 2014 18:52:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754156AbaHKSvp (ORCPT ); Mon, 11 Aug 2014 14:51:45 -0400 Received: from mail-we0-f171.google.com ([74.125.82.171]:62360 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754578AbaHKSv0 (ORCPT ); Mon, 11 Aug 2014 14:51:26 -0400 Received: by mail-we0-f171.google.com with SMTP id p10so9079962wes.16 for ; Mon, 11 Aug 2014 11:51:25 -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:in-reply-to :references; bh=+gv5pvq99eKekN7jsWUnk5GEoKjcHoQy0bpICzBxyjA=; b=RFojoUFNRRJiTS7SXN5XuG2s4y+Xu/T/p9u4kjafQyYgNkjMB9v0wFk26uk+wd2Dqk HPh7HbLV4MjzDa6G4Fy48m5h1AQqPfCAHz3sUxBZqNj2RWFtBChYlBg1mS8kjLPEpy0F iiuPRC3CynNyoFY79NJpcGnxr5+Ln+FtnRLDcoLrOMSuIRBEfT0tYVMqqCMkqK3xAiUh EICUgnQFa8mOenEjdXJEb8tNbrIzoXjQm0D5GKsiAXsvOcvhJiidjYwnQ1OJV/789nuV /y9a0/5kb81ttRUkFQ1sQY74EYtIfVp+oFpuqIBGTag2qAGspHflkctJ11rpDqevgZVF Tj2Q== X-Gm-Message-State: ALoCoQmwLw0PJLID+fKTMIwwe6BdaRXnpV2k0my30JMy0ioQxMgnCL5yDT5KaT1D0mKg+J08vDnc X-Received: by 10.194.205.129 with SMTP id lg1mr1326818wjc.97.1407783085434; Mon, 11 Aug 2014 11:51:25 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id xw9sm3519986wjc.32.2014.08.11.11.51.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Aug 2014 11:51:24 -0700 (PDT) From: Rickard Strandqvist To: Stanislav Yakovlev , "John W. Linville" Cc: Rickard Strandqvist , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: wireless: ipw2x00: ipw2200.c: Cleaning up missing null-terminate in conjunction with strncpy Date: Mon, 11 Aug 2014 20:52:56 +0200 Message-Id: <1407783176-31297-2-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1407783176-31297-1-git-send-email-rickard_strandqvist@spectrumdigital.se> References: <1407783176-31297-1-git-send-email-rickard_strandqvist@spectrumdigital.se> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.6 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/net/wireless/ipw2x00/ipw2200.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index c5aa404..5fb1b5d 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c @@ -5552,7 +5552,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, min(network->ssid_len, priv->essid_len)))) { char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; - strncpy(escaped, + strlcpy(escaped, print_ssid(ssid, network->ssid, network->ssid_len), sizeof(escaped)); @@ -5765,7 +5765,7 @@ static int ipw_best_network(struct ipw_priv *priv, memcmp(network->ssid, priv->essid, min(network->ssid_len, priv->essid_len)))) { char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; - strncpy(escaped, + strlcpy(escaped, print_ssid(ssid, network->ssid, network->ssid_len), sizeof(escaped)); @@ -5782,7 +5782,7 @@ static int ipw_best_network(struct ipw_priv *priv, * testing everything else. */ if (match->network && match->network->stats.rssi > network->stats.rssi) { char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; - strncpy(escaped, + strlcpy(escaped, print_ssid(ssid, network->ssid, network->ssid_len), sizeof(escaped)); IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded because "