[Cluster-devel] cluster/ccs/lib libccs.c

[email protected] <[email protected]>
Newsgroups com.redhat.cluster-devel
Message-ID <[email protected]>
CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	jbrassow at sourceware.org	2008-01-21 22:31:54

Modified files:
	ccs/lib        : libccs.c 

Log message:
	- ccs library now checks for bad file descriptors as input

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/lib/libccs.c.diff?cvsroot=cluster&r1=1.14&r2=1.15

--- cluster/ccs/lib/libccs.c	2008/01/07 05:52:28	1.14
+++ cluster/ccs/lib/libccs.c	2008/01/21 22:31:42	1.15
@@ -409,6 +409,9 @@
 
   ENTER("ccs_disconnect");
 
+  if (desc < 0)
+	  return -EINVAL;
+
   if(!(buffer = malloc(512))){
     error = -ENOMEM;
     goto fail;
@@ -452,6 +455,9 @@
 
   ENTER("_ccs_get");
 
+  if (desc < 0)
+	  return -EINVAL;
+
   if(!(buffer = malloc(512))){
     error = -ENOMEM;
     goto fail;
@@ -535,6 +541,9 @@
 
   ENTER("ccs_get_state");
 
+  if (desc < 0)
+	  return -EINVAL;
+
   if(!(buffer = malloc(512))){
     error = -ENOMEM;
     goto fail;
@@ -594,6 +603,9 @@
 
   ENTER("ccs_set_state");
 
+  if (desc < 0)
+	  return -EINVAL;
+
   if(!(buffer = malloc(512))){
     error = -ENOMEM;
     goto fail;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.