linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH 2/2] Remove a number of stringop-overflow warnings
Date: Tue,  5 Jun 2018 11:30:34 -0400	[thread overview]
Message-ID: <20180605153034.49074-2-steved@redhat.com> (raw)
In-Reply-To: <20180605153034.49074-1-steved@redhat.com>

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 <steved@redhat.com>
---
 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);
 
-- 
2.17.1


  reply	other threads:[~2018-06-05 15:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-05 15:30 [PATCH 1/2] Remove a number of stringop-truncation warnings Steve Dickson
2018-06-05 15:30 ` Steve Dickson [this message]
2018-06-05 17:22   ` [PATCH 2/2] Remove a number of stringop-overflow warnings Steve Dickson
2018-06-05 17:22 ` [PATCH 1/2] Remove a number of stringop-truncation warnings Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180605153034.49074-2-steved@redhat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).