Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2605081imd; Fri, 2 Nov 2018 14:26:16 -0700 (PDT) X-Google-Smtp-Source: AJdET5fAJ6GEO+c0537cxEVrTm+NnvsOjJ0TCubMtvOtJ4MLrOtLsLMbdgdy5W5PKEKHdkKSxxJO X-Received: by 2002:a17:902:7c0c:: with SMTP id x12-v6mr4670970pll.172.1541193976902; Fri, 02 Nov 2018 14:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541193976; cv=none; d=google.com; s=arc-20160816; b=JNAFbkAHGnLKWrEc6kQEFGckjJCsNkXl4xSDJAcON+gGjo3wlgc4dQnxNGats+zu9y yREaqaqqKy/7DKzxOEqXcM//zpiY9nGb5k6aAQYMc396G0lTX/PjqPBj3LqNCOtNl5NL efj1fPkxB8LiSCJ7xZlsufMVXxZfRfdBLWAtOyvuFq7zjkiptvp0oDZQ5c0Ea4uRqEhg 0cCH8cssa6tDyf2fHLnXUxEvgPJws1GUBbG22yiPVU44SJO9D0egRV3BXXn6eNDuTqWc g7T88CJ4EN6PaxqFwc+wATEU9cYysFsYVcdnCkrvGx/oEGEAT3QoESd2xWlOLTk2/Vwe db2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=kLzO9MafblSHtEsANRdd2rJ0NKIfD1wbR4srE4hISEM=; b=f8VYQLyDL/epVQk9zgTdu98fbU7zasK3q9/o4Fk1JbbjX5qzR9BciixjQ5gq4Kf096 uERUhChffIht8wp90aM2ik209TVoPeWoU2c1xqwBEfVmAns+28OYxnFycn3uHfzRp7Io gRmvYhITDzEe0/xsaeoO3k6ueGJZRk6wlVFrEXdPk05pGtPke3bIyNnoKS0NPcA03ou+ Nw6GY4jQlafFQUEkOI39V0cbmjsRdXvS2yd2hAREJEtFkP88oOtO1SPXNXXVSJNgQ2aq XMez5dsYCQ03pu3Rx86qE73aKQauZfSMCaIKgCZIULljxa6xRlBOjnZeWrgvpWFOLmYh 1GDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=BQeLV017; 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 f6-v6si1296204plr.115.2018.11.02.14.26.02; Fri, 02 Nov 2018 14:26:16 -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; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=BQeLV017; 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 S1728215AbeKCGdD (ORCPT + 99 others); Sat, 3 Nov 2018 02:33:03 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39361 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726883AbeKCGdC (ORCPT ); Sat, 3 Nov 2018 02:33:02 -0400 Received: by mail-pg1-f196.google.com with SMTP id r9-v6so1501215pgv.6 for ; Fri, 02 Nov 2018 14:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=kLzO9MafblSHtEsANRdd2rJ0NKIfD1wbR4srE4hISEM=; b=BQeLV017g+iVu4YUURKiI1VX3PN3PvIwXwp/Pgh+eAukS7t7hPaMhQg8yb78zLPPPe rqC1EfiqGTHLNTps3xaXM/9QFt8PmW77RB7huFhOhIDeuZ8ZGqyRjVKDHL/4l8PtIpbA RqsSR2Pt7K9D6vtoYnnNvf7/XFiqgIWZJdmp1tDkjndf2BWoGZiZBFlGwkEpjwjA2t+S o5xZPEETbF8ZDaq1t893aJuZlE12Bigg8PzGYRBUtbbebOM6pZrU2QAY1Ri+11i1/YjD lTbeJaQokup6duwnjzID4Vv+9fsfw3WkHtgwQdGOKLnckf3VUNRc2eFU5KnSgRwHfvD2 et8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kLzO9MafblSHtEsANRdd2rJ0NKIfD1wbR4srE4hISEM=; b=H/X1hR8HMJwqSovMn4Xc0Xs8PrQAW2qfHfqUyFlQMBwymg2uD8WRykoMxA5xXWKNYT Jy8MfcFhGzla9ys4XG8EeiOm7xcfhLeYdK6jp/MCZ5Wq1hnVM1tNIZoBBIDGpxOD2I71 yOefgESJtAGFbVuY+IjqR2hyTEG5pZGVpe/MGShJRb3mYIjQ51cSWvfwuRCjn246Q6bT w/FdlxvqxDByjL7djxt5sx7JT6gYjrnWFnBwuqyB0U8k//jMDIwFUb/1RSFJt8ypX4yT 9IksdgRGBtg2S+64CnzfcIKaF8I+xeiIaHvRizcQLyAgZWFqkwAGfOWWL67+r8iHuYmM 8qtg== X-Gm-Message-State: AGRZ1gK0ZFXlG6KOOeUTadfWHvIZT/bvwD/R3XRf2yfoxC3LbNsuOZXl +9v7eREaQENKm6GjAt3R7FznDA== X-Received: by 2002:a63:6cc:: with SMTP id 195mr12499129pgg.52.1541193857140; Fri, 02 Nov 2018 14:24:17 -0700 (PDT) Received: from localhost.localdomain (99-152-116-91.lightspeed.sntcca.sbcglobal.net. [99.152.116.91]) by smtp.gmail.com with ESMTPSA id b75-v6sm578973pfb.96.2018.11.02.14.24.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 14:24:15 -0700 (PDT) From: Olof Johansson To: Jason Wessel , Daniel Thompson Cc: linux-kernel@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, Olof Johansson Subject: [PATCH] kdb: fix strncpy warning Date: Fri, 2 Nov 2018 14:24:05 -0700 Message-Id: <20181102212405.5911-1-olof@lixom.net> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kdb does a strncpy(a, b, strlen(b)+1), which makes no sense. Might as well do a strcpy at this point. Fixes this warning: In function 'strncpy', inlined from 'kallsyms_symbol_next' at kernel/debug/kdb/kdb_support.c:239:4: ./include/linux/string.h:253:9: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=] Signed-off-by: Olof Johansson --- kernel/debug/kdb/kdb_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/debug/kdb/kdb_support.c b/kernel/debug/kdb/kdb_support.c index 990b3cc526c8..d5af8b38b84d 100644 --- a/kernel/debug/kdb/kdb_support.c +++ b/kernel/debug/kdb/kdb_support.c @@ -236,7 +236,7 @@ int kallsyms_symbol_next(char *prefix_name, int flag) while ((name = kdb_walk_kallsyms(&pos))) { if (strncmp(name, prefix_name, prefix_len) == 0) { - strncpy(prefix_name, name, strlen(name)+1); + strcpy(prefix_name, name); return 1; } } -- 2.11.0