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

          Stephen Tyree created issue -
          Stephen Tyree made changes -
          Field Original Value New Value
          Attachment ZOOKEEPER-1461.PATCH [ 12525220 ]
          Stephen Tyree made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Assignee Stephen Tyree [ tyree731 ]
          Fix Version/s 3.3.6 [ 12320172 ]
          Henry Robinson made changes -
          Link This issue duplicates ZOOKEEPER-1305 [ ZOOKEEPER-1305 ]
          Stephen Tyree made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]
          Patrick Hunt made changes -
          Fix Version/s 3.3.6 [ 12320172 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development