Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp996239rwj; Thu, 22 Dec 2022 18:55:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXtN957iQRAgckeNL0Q9lC2X0hPpI5h2cFPkBQ0VGzPgP1BcKkePfH3rcqjwxRbCNe8HTWYL X-Received: by 2002:a17:902:d355:b0:189:7e2f:d64c with SMTP id l21-20020a170902d35500b001897e2fd64cmr27041529plk.55.1671764154069; Thu, 22 Dec 2022 18:55:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671764154; cv=none; d=google.com; s=arc-20160816; b=vEfnC0iYQH2QuZLz8kQYFl38DJ5Q3AThhkqTyN6t0UBduzpmSmE1iC+Qe6b2Y/7Wsv Dxf4Yw5XE2lYpXIopJ9Fb6Z3duSZdT8+JquguYosgV4TyW1FT5INKrJJ0V4zjfJeQUxz o/5PuhMgIERqPxt6qkBQuShABAOIk7/7tasc6dKIUexotKBuqgcS8Y6X8Fy57fEH84Sr tvZe3yQa9il5yvqRMeCSjoH+OS7jQmK8CgHTg0MgFZ8hHGGCK0eZfGwvqLnc4Rrc330M pZNrDTSWBqHrf5rr9zhkztYlIMy5NsnGjgIOyswc8JbKtgcecw+OVdowqnzQpwOjE6WP 8puw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=Sfe+ossvaFDHtSIQjPIbtiE0baSBN8K4HP8DanMsqU4=; b=zD3y4gtZmIdx9teSn9mFt7tr99NUdTqqrMBn7kEdZ5i9MVz1hNGYVmF3jldmMATF4K CX3TTfQKJiBFiIHP/mXnwpHxR67V2K43oYWfzpUoKS/C9jkRMGY7frPPQnFh9jRVZX9G xAmiQQPdo6VWeJQPCMuUJZWjMV3YrC4ue2QLsl7taDipcpIW/YdhLL8Tcwl11S/+/zNM odXucMq+MT2g/sDoVtW+t6M9vdDL0gUPhDpKQQsROYB3Jes9wqh+O8PE+WTUbQbVICrZ AndaReCXeYWiu4iBA74bWxoYSkQuDjxYtWujAP4SYIN2jGgsWC/ptrEmtRTO4NLzPko2 Dzxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a170902e80b00b001869ba21491si2504305plg.8.2022.12.22.18.55.45; Thu, 22 Dec 2022 18:55:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235919AbiLWCwR (ORCPT + 66 others); Thu, 22 Dec 2022 21:52:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235913AbiLWCwO (ORCPT ); Thu, 22 Dec 2022 21:52:14 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1069B2180C; Thu, 22 Dec 2022 18:52:13 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NdWtM3l67z4y3Zt; Fri, 23 Dec 2022 10:52:11 +0800 (CST) Received: from szxlzmapp02.zte.com.cn ([10.5.231.79]) by mse-fl2.zte.com.cn with SMTP id 2BN2q3Jf060236; Fri, 23 Dec 2022 10:52:03 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Fri, 23 Dec 2022 10:52:04 +0800 (CST) Date: Fri, 23 Dec 2022 10:52:04 +0800 (CST) X-Zmail-TransId: 2b0463a517d4ffffffffadba9bb8 X-Mailer: Zmail v1.0 Message-ID: <202212231052044562664@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , , , , , , , Subject: =?UTF-8?B?W1BBVENIIG5ldC1uZXh0XSB3aWZpOiBhaXJvOiB1c2Ugc3Ryc2NweSgpIHRvIGluc3RlYWQgb2Ygc3RybmNweSgp?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2BN2q3Jf060236 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 63A517DB.001 by FangMail milter! X-FangMail-Envelope: 1671763931/4NdWtM3l67z4y3Zt/63A517DB.001/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63A517DB.001/4NdWtM3l67z4y3Zt X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Xu Panda The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL-terminated strings. Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- drivers/net/wireless/cisco/airo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/cisco/airo.c b/drivers/net/wireless/cisco/airo.c index 7c4cc5f5e1eb..600a64f671ce 100644 --- a/drivers/net/wireless/cisco/airo.c +++ b/drivers/net/wireless/cisco/airo.c @@ -6067,8 +6067,7 @@ static int airo_get_nick(struct net_device *dev, struct airo_info *local = dev->ml_priv; readConfigRid(local, 1); - strncpy(extra, local->config.nodeName, 16); - extra[16] = '\0'; + strscpy(extra, local->config.nodeName, 17); dwrq->length = strlen(extra); return 0; -- 2.15.2