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

addrvec_next() fails to set next parameter if addrvec_hasnext() returns false

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.0
    • Component/s: c client
    • Labels:
      None

      Description

      There is a relatively innocuous but useless pointer assignment in
      addrvec_next():

      195 void addrvec_next(addrvec_t *avec, struct sockaddr_storage *next)
      ....
      203 if (!addrvec_hasnext(avec))
      204 {
      205 next = NULL;
      206 return;

      That assignment on (205) has no point, as next is a local variable lost upon function return. Likely this should be a memset to zero out the actual parameter.

        Attachments

        1. ZOOKEEPER-1836.patch
          0.3 kB
          Michi Mutsuzaki
        2. ZOOKEEPER-1836.patch
          0.3 kB
          Dutch T. Meyer

          Activity

            People

            • Assignee:
              dutch Dutch T. Meyer
              Reporter:
              dutch Dutch T. Meyer
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: