All of lore.kernel.org
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/cman/daemon cmanccs.c
Date: 24 Oct 2007 05:58:07 -0000	[thread overview]
Message-ID: <20071024055807.1373.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rmccabe at sourceware.org	2007-10-24 05:58:07

Modified files:
	cman/daemon    : cmanccs.c 

Log message:
	Commit msg with the last commit went missing..
	
	- Fix unsafe string handling:
	- replace memset(s,c,n);sprintf(s,...); with snprintf with proper error checking
	- don't overflow the stack if the cluster name specified in the env var is too long
	- don't overflow the stack if the local nodename from uname(2) is too long
	- don't overflow the stack if the local nodename specified in the env var is too long
	
	- Don't leak the ccs descriptor in get_ccs_join_info() on errors
	- Fix a couple of small memory leaks in error paths
	- Handle OOM conditions

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&r1=1.35&r2=1.36

--- cluster/cman/daemon/cmanccs.c	2007/10/24 05:55:07	1.35
+++ cluster/cman/daemon/cmanccs.c	2007/10/24 05:58:07	1.36
@@ -637,6 +637,8 @@
 	/* optional security key filename */
 	if (getenv("CMAN_KEYFILE")) {
 		key_filename = strdup(getenv("CMAN_KEYFILE"));
+		if (key_filename == NULL)
+			return -ENOMEM;
 	}
 	else {
 		error = ccs_get(cd, KEY_PATH, &str);
@@ -662,13 +664,13 @@
 		error = ccs_get(cd, path, &str);
 		if (!error) {
 			int votestmp = atoi(str);
+			free(str);
 			if (votestmp < 0 || votestmp > 255) {
 				log_printf(LOG_ERR, "invalid votes value %d", votestmp);
 				write_cman_pipe("Found invalid votes for node in CCS");
 				return -EINVAL;
 			}
 			votes = votestmp;
-			free(str);
 		}
 		else {
 			votes = 1;



             reply	other threads:[~2007-10-24  5:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24  5:58 rmccabe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-11-05 16:03 [Cluster-devel] cluster/cman/daemon cmanccs.c pcaulfield
2007-10-24  5:55 rmccabe
2007-10-24  7:27 ` Fabio Massimo Di Nitto
2007-10-24  3:21 fabbione
2007-10-24  3:21 fabbione
2007-10-24  3:20 fabbione
2007-08-17  7:51 pcaulfield
2007-08-03 10:49 pcaulfield
2007-08-03  7:35 pcaulfield
2007-05-23 10:31 pcaulfield
2007-03-15 11:12 pcaulfield
2007-03-15  9:27 pcaulfield
2007-01-02 15:17 pcaulfield
2007-01-02 15:04 pcaulfield
2006-12-15 15:17 pcaulfield
2006-12-15 13:43 pcaulfield
2006-11-30 10:47 pcaulfield
2006-11-30 10:46 pcaulfield
2006-07-03  8:51 pcaulfield

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=20071024055807.1373.qmail@sourceware.org \
    --to=rmccabe@sourceware.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.