cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Jan Pokorný <jpokorny@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 2/3] libcman: fix possible string nontermination: barrier name
Date: Thu, 11 Oct 2012 16:21:06 +0200	[thread overview]
Message-ID: <1349965267-2261-3-git-send-email-jpokorny@redhat.com> (raw)
In-Reply-To: <1349965267-2261-1-git-send-email-jpokorny@redhat.com>

Similar to node name case (separate changeset).

Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
 cman/lib/libcman.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cman/lib/libcman.c b/cman/lib/libcman.c
index 012047d..f27e726 100644
--- a/cman/lib/libcman.c
+++ b/cman/lib/libcman.c
@@ -912,7 +912,7 @@ int cman_barrier_register(cman_handle_t handle, const char *name, int flags, int
 	}
 
 	binfo.cmd = BARRIER_CMD_REGISTER;
-	strncpy(binfo.name, name, sizeof(binfo.name) - 1);
+	strncpy(binfo.name, name, sizeof(binfo.name));
 	binfo.arg = nodes;
 	binfo.flags = flags;
 
@@ -933,7 +933,7 @@ int cman_barrier_change(cman_handle_t handle, const char *name, int flags, int a
 	}
 
 	binfo.cmd = BARRIER_CMD_CHANGE;
-	strncpy(binfo.name, name, sizeof(binfo.name) - 1);
+	strncpy(binfo.name, name, sizeof(binfo.name));
 	binfo.arg = arg;
 	binfo.flags = flags;
 
@@ -954,7 +954,7 @@ int cman_barrier_wait(cman_handle_t handle, const char *name)
 	}
 
 	binfo.cmd = BARRIER_CMD_WAIT;
-	strncpy(binfo.name, name, sizeof(binfo.name) - 1);
+	strncpy(binfo.name, name, sizeof(binfo.name));
 
 	return info_call(h, CMAN_CMD_BARRIER, &binfo, sizeof(binfo), NULL, 0);
 }
@@ -972,7 +972,7 @@ int cman_barrier_delete(cman_handle_t handle, const char *name)
 	}
 
 	binfo.cmd = BARRIER_CMD_DELETE;
-	strncpy(binfo.name, name, sizeof(binfo.name) - 1);
+	strncpy(binfo.name, name, sizeof(binfo.name));
 
 	return info_call(h, CMAN_CMD_BARRIER, &binfo, sizeof(binfo), NULL, 0);
 }
-- 
1.7.11.4



  parent reply	other threads:[~2012-10-11 14:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 14:21 [Cluster-devel] [PATCH 0/3] libcman: fix possible string nontermination Jan Pokorný
2012-10-11 14:21 ` [Cluster-devel] [PATCH 1/3] libcman: fix possible string nontermination: node name Jan Pokorný
2012-10-11 14:21 ` Jan Pokorný [this message]
2012-10-11 14:21 ` [Cluster-devel] [PATCH 3/3] libcman: fix possible string nontermination: barrier name Jan Pokorný
2012-10-11 14:36 ` [Cluster-devel] [PATCH 0/3] libcman: fix possible string nontermination Christine Caulfield

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=1349965267-2261-3-git-send-email-jpokorny@redhat.com \
    --to=jpokorny@redhat.com \
    /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).