Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-48367

envp may be unreliable in global initializers

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0, 4.4.13
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Service arch 2020-06-01, Service arch 2020-06-15, Service arch 2020-06-29
    • 50

      Hypothetical cause of BF-17563.

      We clone the envp we got from main(argv,argc,env) into the InitializerContext.
      I believe it may be corrupted by static initializers by the time main runs.
      We can use environ instead. A better fix would be to change idiom so that InitializerContext provides a getenv accessor instead of a full snapshot of the environment. Nobody should need to see everything in the environment, they can pick out the keys they're interested in one by one. That's safer than a snapshot.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: