Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp241674imm; Thu, 12 Jul 2018 18:27:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdPuYQunJSzw04YZmqJHRP2An6YdiUegCdBNl9J2AUyL+jHMwheouv66M88wHa+l7bMFuXS X-Received: by 2002:a63:195e:: with SMTP id 30-v6mr4082101pgz.192.1531445221907; Thu, 12 Jul 2018 18:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531445221; cv=none; d=google.com; s=arc-20160816; b=gcQNs+fyHNw19LWvCy/T0neMhw6EWc7+/gnt6G/08ftnqDGrUrLNui4gnN8AMiZHgl KlgVFmCwBkEi3caWzLSi0V7yOuzPyloi8ja4Ydl21B5N6N2UL+PGmwTUeociucpEJWar SaeBro9m6jFLvvY0GOQiBk7A4mEDXgDNa8Cl43haJ/KYHnHbHAwQzkFeRDA1kNSTWfCF eZw2Yn4kmNcFZm5mC9GdDkIRTFSL4+dwjsgmD3M9fw9cIAj/VXEPXboYVR8zwKw/4J3x NMZL7Y9Ab7m5n/CNT62RiDw7p/9iVv4S7AoBNIcA/2dUjrcVBMJ6VHSbTrw6ap29lDDz mO2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from:arc-authentication-results; bh=vIP9tZIdhKeM6oznQ9k4CM8aYRr83ksR02cqfLh9QQ0=; b=R3qP/a9ZDDU3U4sXuPIfi0CN3YkooesVZzE07fUH22EZleMoHr1J1zig2TZlSL2uT6 tlnrUyH8Fom5FtKm5W7aVlcQa33k7mJYneCEO8SULLSF/QTS7Q+XijnIaoFh6EzNeCyo +Ma65wfQWq3pkctqaJSwaP1DkBlyIYYsogoXDg1sffVZ12ow5r6TKLcLKcnZWzz/D3XC eT7zhXM+dHuS/wgs+lCVVT/D36G0CYS1Pb5BPzFwNcHGlzHPdcPjiCVGFpg9/jEHt/1N qbAm0wOAGvACigsuGvluu96CDbKsUmH+BHxT5zn/HQsn7DF25qj2adLYWff+9U7RL+AG L8Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k19-v6si23027543pgi.494.2018.07.12.18.26.47; Thu, 12 Jul 2018 18:27:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388062AbeGMBh7 (ORCPT + 99 others); Thu, 12 Jul 2018 21:37:59 -0400 Received: from nautica.notk.org ([91.121.71.147]:43008 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387896AbeGMBh6 (ORCPT ); Thu, 12 Jul 2018 21:37:58 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id B66B8C024; Fri, 13 Jul 2018 03:25:45 +0200 (CEST) From: Dominique Martinet Cc: Dominique Martinet , Ariel Elior , everest-linux-l2@cavium.com, "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/18] qlogic/qed: change strncpy+truncation to strlcpy Date: Fri, 13 Jul 2018 03:25:44 +0200 Message-Id: <1531445144-19521-1-git-send-email-asmadeus@codewreck.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1531444483-17338-1-git-send-email-asmadeus@codewreck.org> References: <1531444483-17338-1-git-send-email-asmadeus@codewreck.org> To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Generated by scripts/coccinelle/misc/strncpy_truncation.cocci Signed-off-by: Dominique Martinet --- Please see https://marc.info/?l=linux-kernel&m=153144450722324&w=2 (the first patch of the serie) for the motivation behind this patch drivers/net/ethernet/qlogic/qed/qed_debug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_debug.c b/drivers/net/ethernet/qlogic/qed/qed_debug.c index a14e48489029..4fe0a72230e8 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_debug.c +++ b/drivers/net/ethernet/qlogic/qed/qed_debug.c @@ -6212,8 +6212,7 @@ static void qed_read_str_from_buf(void *buf, u32 *offset, u32 size, char *dest) { const char *source_str = &((const char *)buf)[*offset]; - strncpy(dest, source_str, size); - dest[size - 1] = '\0'; + strlcpy(dest, source_str, size); *offset += size; } -- 2.17.1