Skip to contentSkip to conversation

cluster/ccs/lib libccs.c

Cluster-devel [email protected] 1 participant 1 message Jan 21, 2008

lore
Share & tools
lore
#0 lore raw

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

ccs/lib/libccs.c +12 -0
@@ -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;