From patchwork Tue Jun 5 15:30:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10448499 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1BC52600CA for ; Tue, 5 Jun 2018 15:32:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F8A829F21 for ; Tue, 5 Jun 2018 15:32:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09E7829A83; Tue, 5 Jun 2018 15:32:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E82829A92 for ; Tue, 5 Jun 2018 15:30:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751599AbeFEPah (ORCPT ); Tue, 5 Jun 2018 11:30:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53644 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751665AbeFEPag (ORCPT ); Tue, 5 Jun 2018 11:30:36 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2B6A810D44C for ; Tue, 5 Jun 2018 15:30:36 +0000 (UTC) Received: from steved.boston.devel.redhat.com (steved.boston.devel.redhat.com [10.19.60.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0466C10FFE73 for ; Tue, 5 Jun 2018 15:30:35 +0000 (UTC) From: Steve Dickson To: Linux NFS Mailing list Subject: [PATCH 2/2] Remove a number of stringop-overflow warnings Date: Tue, 5 Jun 2018 11:30:34 -0400 Message-Id: <20180605153034.49074-2-steved@redhat.com> In-Reply-To: <20180605153034.49074-1-steved@redhat.com> References: <20180605153034.49074-1-steved@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 05 Jun 2018 15:30:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 05 Jun 2018 15:30:36 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'steved@redhat.com' RCPT:'' Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP umich_ldap.c:1128:3: warning: ‘strncat’ specified bound 128 equals destination size [-Wstringop-overflow=] umich_ldap.c:1130:3: warning: ‘strncat’ specified bound 128 equals destination size [-Wstringop-overflow=] idmapd.c:313:2: warning: ‘strncat’ specified bound 4096 equals destination size [-Wstringop-overflow=] Signed-off-by: Steve Dickson --- support/nfsidmap/umich_ldap.c | 4 ++-- utils/idmapd/idmapd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/support/nfsidmap/umich_ldap.c b/support/nfsidmap/umich_ldap.c index 0e31b1c..b661110 100644 --- a/support/nfsidmap/umich_ldap.c +++ b/support/nfsidmap/umich_ldap.c @@ -1125,9 +1125,9 @@ umichldap_init(void) /* Verify required information is supplied */ if (server_in == NULL || strlen(server_in) == 0) - strncat(missing_msg, "LDAP_server ", sizeof(missing_msg)); + strncat(missing_msg, "LDAP_server ", sizeof(missing_msg)-1); if (ldap_info.base == NULL || strlen(ldap_info.base) == 0) - strncat(missing_msg, "LDAP_base ", sizeof(missing_msg)); + strncat(missing_msg, "LDAP_base ", sizeof(missing_msg)-1); if (strlen(missing_msg) != 0) { IDMAP_LOG(0, ("umichldap_init: Missing required information: " "%s", missing_msg)); diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c index 2585fb2..4811e0f 100644 --- a/utils/idmapd/idmapd.c +++ b/utils/idmapd/idmapd.c @@ -310,7 +310,7 @@ main(int argc, char **argv) if (!serverstart && !clientstart) errx(1, "it is illegal to specify both -C and -S"); - strncat(pipefsdir, "/nfs", sizeof(pipefsdir)); + strncat(pipefsdir, "/nfs", sizeof(pipefsdir)-1); daemon_init(fg);