zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1212566 - in /zookeeper/trunk: CHANGES.txt src/c/src/zookeeper.c
Date Fri, 09 Dec 2011 18:36:28 GMT
Author: mahadev
Date: Fri Dec  9 18:36:27 2011
New Revision: 1212566

URL: http://svn.apache.org/viewvc?rev=1212566&view=rev
Log:
ZOOKEEPER-1317. Possible segfault in zookeeper_init. (Akira Kitada via mahadev)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/c/src/zookeeper.c

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1212566&r1=1212565&r2=1212566&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Fri Dec  9 18:36:27 2011
@@ -71,6 +71,8 @@ BUGFIXES:
 
   ZOOKEEPER-1315. zookeeper_init always reports sessionPasswd=<hidden>.
   (Akira Kitada via mahadev)
+
+  ZOOKEEPER-1317. Possible segfault in zookeeper_init. (Akira Kitada via mahadev)
  
 IMPROVEMENTS:
 

Modified: zookeeper/trunk/src/c/src/zookeeper.c
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/c/src/zookeeper.c?rev=1212566&r1=1212565&r2=1212566&view=diff
==============================================================================
--- zookeeper/trunk/src/c/src/zookeeper.c (original)
+++ zookeeper/trunk/src/c/src/zookeeper.c Fri Dec  9 18:36:27 2011
@@ -802,6 +802,9 @@ zhandle_t *zookeeper_init(const char *ho
     index_chroot = strchr(host, '/');
     if (index_chroot) {
         zh->chroot = strdup(index_chroot);
+        if (zh->chroot == NULL) {
+            goto abort;
+        }
         // if chroot is just / set it to null
         if (strlen(zh->chroot) == 1) {
             free(zh->chroot);



Mime
View raw message