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

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

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: 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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: