Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp636450imm; Fri, 13 Jul 2018 03:51:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcI98suhdOsh4dkxDuJxitdpwmCe3Iqshc2aNMz7TwJFZkfmKzqj41b+ANxV0BNl4l7zEfv X-Received: by 2002:a62:cac5:: with SMTP id y66-v6mr6493670pfk.187.1531479119004; Fri, 13 Jul 2018 03:51:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531479118; cv=none; d=google.com; s=arc-20160816; b=0ezhqIgcHlWPFCf6XhBOFipCB+0+rOrTR718Z4640sRas578Xej8AzCCSxJLGgAhjR x5C4Fkkkn7Sqr38ewR8t7d2M7Xf2WVWV1NnfHVv7TeG4qfvTXvE9PwfBMCNd0HW/iA9C lkPAULINvGv6sW3LsrHSxHu6BUSqb2jxpRCrFrritX0RSgvk89NzOBSUn3Yo+kO2+plX s7drcfl6bCX3045HNB5ZVVs8yb4tsv535ldgTpLg/3SfY/+1KFjJD9Se0W6q441nJcuD qFQ0xEpVgvL5WWNWuz2CQX3Tw4IXE2+2VH3X4xTwqhbWcH6Y0FMEVm7m0hxCpBQLibC3 89nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=VYHlQ6i6UUZzwsNaE+U1j/gf1sXjM96sjCIqxoy/oaQ=; b=VCGFdfJKTQdcD8dSRTx2+aIZYMrxYuhyzxkudDFTiRZtX4JEjyYRuWSTGA7QzCN6s+ 5pe8fgSfAAzRlfh/ZfjxPWOWu3kOfYujoXUeshyYwleYqmpS9J21rx6+uybXjM2hLAAk Qc5wr7krD3CAzz8KI3GTdpx0uiqkR/I35F3Zv69ILsFzmSVY1W6KfWxyC8JNNWcnz6sx hDxtT+syxE3uNG0orvH3odfoNGcPo60Hg31vDpZ3caZS170/9qIdlFcb9/E40BeYUQ4E J1PuqDiI4w+LMDy5Pj1gI5sPAjBZ4buUVbNOz4UPdfF77Rk5GbleGwCzA52iE+/iibau 0DLA== 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 34-v6si23692754plc.346.2018.07.13.03.51.43; Fri, 13 Jul 2018 03:51:58 -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 S1729626AbeGMLEY (ORCPT + 99 others); Fri, 13 Jul 2018 07:04:24 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:37410 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727307AbeGMLEY (ORCPT ); Fri, 13 Jul 2018 07:04:24 -0400 X-IronPort-AV: E=Sophos;i="5.51,347,1526335200"; d="scan'208";a="338772611" Received: from unknown (HELO hadrien.local) ([38.97.127.241]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jul 2018 12:50:14 +0200 Date: Fri, 13 Jul 2018 06:50:13 -0400 (EDT) From: Julia Lawall X-X-Sender: jll@hadrien To: Himanshu Jha cc: Dominique Martinet , Michal Marek , Nicolas Palix , linux-kernel@vger.kernel.org, =?ISO-8859-15?Q?Ville_Syrj=E4l=E4?= , yamada.masahiro@socionext.com, cocci@systeme.lip6.fr Subject: Re: [Cocci] [PATCH 01/18] coccinelle: change strncpy+truncation to strlcpy In-Reply-To: <20180713102103.GA12972@himanshu-Vostro-3559> Message-ID: References: <1531444483-17338-1-git-send-email-asmadeus@codewreck.org> <20180713074455.GA6859@himanshu-Vostro-3559> <20180713080023.GB9638@nautica> <20180713091412.GA11250@himanshu-Vostro-3559> <20180713102103.GA12972@himanshu-Vostro-3559> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For the file drivers/net/wireless/ti/wl1251/acx.c, the following keeps the comment before the buf update and moves the strlcpy call below it. It does however drop the comment just before the original call to strncpy. julia @r@ expression dest, src; expression f; @@ - strncpy(dest,src,f); dest[f - 1] = '\0' + + strlcpy(dest,src,f) ; @@ expression r.dest, r.src; expression r.f; @@ - dest[f - 1] = '\0' + strlcpy(dest,src,f); + strlcpy(dest,src,f);