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

initialize last parameter of getpwuid_r

XMLWordPrintable

    • b06
    • generic
    • generic

        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

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

                Created:
                Updated:
                Resolved: