ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1461

Zookeeper C client doesn't check for NULL before dereferencing in prepend_string

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 3.3.5
    • Fix Version/s: None
    • Component/s: c client
    • Labels:
      None

      Description

      prepend_string, called before any checks for NULL in the c client for many API functions, has this line (zookeeper 3.3.5):

      if (zh->chroot == NULL)

      That means that before you check for NULL, you are dereferencing the pointer. This bug does not exist in the 3.4.* branch for whatever reason, but it still remains in the 3.3.* line. A patch which fixes it would make the line as follows:

      if (zh == NULL || zh->chroot == NULL)

      I would do that for you, but I don't know how to patch the 3.3.5 branch.

      1. ZOOKEEPER-1461.PATCH
        0.5 kB
        Stephen Tyree

        Issue Links

          Activity

          Hide
          Stephen Tyree added a comment -

          Duplicate of ZOOKEEPER-1305 , will be resolved there. Thanks everyone.

          Show
          Stephen Tyree added a comment - Duplicate of ZOOKEEPER-1305 , will be resolved there. Thanks everyone.
          Hide
          Henry Robinson added a comment -

          See ZOOKEEPER-1305 - this was fixed in trunk and 3.4, but not in 3.3. We should probably close this as a duplicate and commit 1305 to 3.3. See my comment there.

          Show
          Henry Robinson added a comment - See ZOOKEEPER-1305 - this was fixed in trunk and 3.4, but not in 3.3. We should probably close this as a duplicate and commit 1305 to 3.3. See my comment there.
          Hide
          Michi Mutsuzaki added a comment -

          Yeah it looks like it's trying to apply the patch to trunk. I don't know how to specify the build to use a specific branch. Any suggestions?

          Thanks!
          --Michi

          Show
          Michi Mutsuzaki added a comment - Yeah it looks like it's trying to apply the patch to trunk. I don't know how to specify the build to use a specific branch. Any suggestions? Thanks! --Michi
          Hide
          Stephen Tyree added a comment -

          Was it trying to apply the patch to trunk or the 3.3 branch?

          Show
          Stephen Tyree added a comment - Was it trying to apply the patch to trunk or the 3.3 branch?
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12525220/ZOOKEEPER-1461.PATCH
          against trunk revision 1331246.

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no new tests are needed for this patch.
          Also please list what manual steps were performed to verify this patch.

          -1 patch. The patch command could not apply the patch.

          Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1056//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12525220/ZOOKEEPER-1461.PATCH against trunk revision 1331246. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1056//console This message is automatically generated.
          Hide
          Michi Mutsuzaki added a comment -

          ... should have previewed before posting....

          svn co http://svn.apache.org/repos/asf/zookeeper/branches/branch-3.3/
          
          Show
          Michi Mutsuzaki added a comment - ... should have previewed before posting.... svn co http: //svn.apache.org/repos/asf/zookeeper/branches/branch-3.3/
          Hide
          Michi Mutsuzaki added a comment -

          Hi Stephen,

          The 3.3.* branch is under branches/branch-3.3. You can checkout the branch and make your change there.

          
          

          svn co http://svn.apache.org/repos/asf/zookeeper/branches/branch-3.3/
          {code]

          Thanks!
          --Michi

          Show
          Michi Mutsuzaki added a comment - Hi Stephen, The 3.3.* branch is under branches/branch-3.3. You can checkout the branch and make your change there. svn co http://svn.apache.org/repos/asf/zookeeper/branches/branch-3.3/ {code] Thanks! --Michi

            People

            • Assignee:
              Stephen Tyree
              Reporter:
              Stephen Tyree
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development