cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: lhh@sourceware.org <lhh@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/ccs/daemon cnx_mgr.c
Date: 8 May 2007 14:26:19 -0000	[thread overview]
Message-ID: <20070508142619.9337.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	lhh at sourceware.org	2007-05-08 14:26:18

Modified files:
	ccs/daemon     : cnx_mgr.c 

Log message:
	Apply patch to fix bugzilla # 232140

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/daemon/cnx_mgr.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.41.2.1&r2=1.41.2.2

--- cluster/ccs/daemon/cnx_mgr.c	2007/02/14 16:20:23	1.41.2.1
+++ cluster/ccs/daemon/cnx_mgr.c	2007/05/08 14:26:18	1.41.2.2
@@ -871,33 +871,41 @@
 	      (node->type == 1)? "XML_ELEMENT_NODE":
 	      (node->type == 2)? "XML_ATTRIBUTE_NODE":"");
 
-      if(!node || !node->children ||
-         !node->children->content || !strlen((char *)node->children->content)){
+      if(!node) {
 	log_dbg("No content found.\n");
 	error = -ENODATA;
 	goto fail;
       }
 
-      log_dbg("Query results:: %s\n", node->children->content);
-
       if(((node->type == XML_ATTRIBUTE_NODE) && strstr(query, "@*")) ||
 	 ((node->type == XML_ELEMENT_NODE) && strstr(query, "child::*"))){
 	/* add on the trailing NULL and the '=' separator for a list of attrs
 	   or an element node + CDATA*/
-	size = strlen((char *)node->children->content) +
-	  strlen((char *)node->name)+2;
+ 	if (node->children && node->children->content)
+ 	  size = strlen((char *)node->children->content) +
+		 strlen((char *)node->name)+2;
+ 	else 
+ 	  size = strlen((char *)node->name)+2;
 	nnv= 1;
       } else {
-	size = strlen((char *)node->children->content) + 1;
+ 	if (node->children && node->children->content) {
+ 	  size = strlen((char *)node->children->content)+1;
+	} else {
+          error = -ENODATA;
+ 	  goto fail;
+        }
       }
 
       if(size <= ch->comm_payload_size){  /* do we already have enough space? */
 	log_dbg("No extra space needed.\n");
 	if(nnv){
-	  sprintf(*payload, "%s=%s", node->name,node->children->content);
-	}else {
-	  sprintf(*payload, "%s", node->children->content);
+ 	  sprintf(*payload, "%s=%s", node->name, node->children ?
+ 					 (char *)node->children->content:"");
+	} else {
+ 	  sprintf(*payload, "%s", node->children ? node->children->content :
+ 				  node->name);
 	}
+
       } else {
 	log_dbg("Extra space needed.\n");
 	free(*payload);
@@ -907,11 +915,14 @@
 	  goto fail;
 	}
 	if(nnv){
-	  sprintf(*payload, "%s=%s", node->name, node->children->content);
-	}else {
-	  sprintf(*payload, "%s", node->children->content);
+ 	  sprintf(*payload, "%s=%s", node->name, node->children ?
+ 					 (char *)node->children->content:"");
+	} else {
+ 	  sprintf(*payload, "%s", node->children ? node->children->content :
+ 				  node->name);
 	}
       }
+      log_dbg("Query results:: %s\n", *payload);
       ch->comm_payload_size = size;
     } else {
       log_dbg("No nodes found.\n");
@@ -1081,7 +1092,7 @@
     goto fail;
   }
 
-  if(ch->comm_desc < 0 || ch->comm_desc >= MAX_OPEN_CONNECTIONS){
+  if(ch->comm_desc < 0){
     log_err("Invalid descriptor specified (%d).\n", ch->comm_desc);
     log_err("Someone may be attempting something evil.\n");
     error = -EBADR;



             reply	other threads:[~2007-05-08 14:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-08 14:26 lhh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-02-05 22:16 [Cluster-devel] cluster/ccs/daemon cnx_mgr.c cfeist
2007-12-11 20:58 rohara
2007-12-11 20:57 rohara
2007-12-11 20:56 rohara
2007-05-08 14:25 lhh
2007-03-19 20:03 lhh
2007-02-14 16:23 rohara
2007-02-14 16:22 rohara
2007-02-14 16:20 rohara
2007-02-13 20:54 rohara
2006-06-15 21:39 lhh
2006-06-15 21:39 lhh

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=20070508142619.9337.qmail@sourceware.org \
    --to=lhh@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 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).