Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1461

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 3.3.5
    • None
    • c client
    • 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.

      Attachments

        1. ZOOKEEPER-1461.PATCH
          0.5 kB
          Stephen Tyree

        Issue Links

          Activity

            People

              tyree731 Stephen Tyree
              tyree731 Stephen Tyree
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: