Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8259786

initialize last parameter of getpwuid_r

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b06
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        We have a couple of
        g= getpwuid_r(getuid(), &resbuf, pwd_buf, sizeof(pwd_buf), &pwd);
        calls in the codebase.
        Usually we NULL-check pwd after the call because we do not fully trust the return code of the function (it is documented in the codebase why we do not fully trust the return code) . However we miss to initialize pwd at some places before the call, which might we a little problematic and should be improved.

        This triggers also Sonar warnings like :
        https://sonarcloud.io/project/issues?id=jdk&open=AXaE0dsA8L9hkQskGEbA&resolved=false&types=BUG

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                mbaesken Matthias Baesken
                Reporter:
                mbaesken Matthias Baesken
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: