Browse Source

ZOOKEEPER-2133 zkperl: Segmentation fault if getting a node with null value (Botond Hejj via phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1734498 13f79535-47bb-0310-9956-ffa450edef68
Patrick D. Hunt 9 years ago
parent
commit
7870727577
2 changed files with 4 additions and 1 deletions
  1. 3 0
      CHANGES.txt
  2. 1 1
      src/contrib/zkperl/ZooKeeper.xs

+ 3 - 0
CHANGES.txt

@@ -260,6 +260,9 @@ BUGFIXES:
   ZOOKEEPER-2379: recent commit broke findbugs qabot check
   ZOOKEEPER-2379: recent commit broke findbugs qabot check
   (rakeshr via cnauroth)
   (rakeshr via cnauroth)
 
 
+  ZOOKEEPER-2133 zkperl: Segmentation fault if getting a node with
+  null value (Botond Hejj via phunt)
+
 IMPROVEMENTS:
 IMPROVEMENTS:
   ZOOKEEPER-1660 Documentation for Dynamic Reconfiguration (Reed Wanderman-Milne via shralex)  
   ZOOKEEPER-1660 Documentation for Dynamic Reconfiguration (Reed Wanderman-Milne via shralex)  
 
 

+ 1 - 1
src/contrib/zkperl/ZooKeeper.xs

@@ -1713,7 +1713,7 @@ zk_get(zkh, path, ...)
                               old_watch, new_watch);
                               old_watch, new_watch);
         }
         }
 
 
-        if (ret == ZOK) {
+        if (ret == ZOK && buf_len != -1) {
             ST(0) = sv_newmortal();
             ST(0) = sv_newmortal();
 #ifdef SV_HAS_TRAILING_NUL
 #ifdef SV_HAS_TRAILING_NUL
             buf[buf_len] = '\0';
             buf[buf_len] = '\0';