hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r790257 - in /hadoop/zookeeper/branches/branch-3.2: CHANGES.txt src/c/src/zookeeper.c
Date Wed, 01 Jul 2009 16:38:34 GMT
Author: phunt
Date: Wed Jul  1 16:38:34 2009
New Revision: 790257

URL: http://svn.apache.org/viewvc?rev=790257&view=rev
Log:
ZOOKEEPER-455. zookeeper c client crashes with chroot specified in the string.

Modified:
    hadoop/zookeeper/branches/branch-3.2/CHANGES.txt
    hadoop/zookeeper/branches/branch-3.2/src/c/src/zookeeper.c

Modified: hadoop/zookeeper/branches/branch-3.2/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.2/CHANGES.txt?rev=790257&r1=790256&r2=790257&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.2/CHANGES.txt (original)
+++ hadoop/zookeeper/branches/branch-3.2/CHANGES.txt Wed Jul  1 16:38:34 2009
@@ -151,7 +151,10 @@
   ZOOKEEPER-453. Worker is not removed in QuorumCnxManager upon crash.
   (flavio via mahadev)
 
-  ZOOKEEPER-454. allow compilation with jdk1.5
+  ZOOKEEPER-454. allow compilation with jdk1.5 (phunt)
+
+  ZOOKEEPER-455. zookeeper c client crashes with chroot specified in the string.
+  (phunt via mahadev)
 
 IMPROVEMENTS:
   ZOOKEEPER-308. improve the atomic broadcast performance 3x.

Modified: hadoop/zookeeper/branches/branch-3.2/src/c/src/zookeeper.c
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.2/src/c/src/zookeeper.c?rev=790257&r1=790256&r2=790257&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.2/src/c/src/zookeeper.c (original)
+++ hadoop/zookeeper/branches/branch-3.2/src/c/src/zookeeper.c Wed Jul  1 16:38:34 2009
@@ -645,13 +645,14 @@
         zh->hostname = (char *) malloc(index_chroot - host + 1);
         zh->hostname = strncpy(zh->hostname, host, (index_chroot - host));
         //strncpy does not null terminate
-        *(zh->hostname + (index_chroot - host) +1) = '\0';
+        *(zh->hostname + (index_chroot - host)) = '\0';
         
     } else {
         zh->chroot = NULL;
         zh->hostname = strdup(host);
     }
     if (zh->chroot && !isValidPath(zh->chroot, 0)) { 
+        errno = EINVAL;
         goto abort;
     }
     if (zh->hostname == 0) {



Mime
View raw message