envp may be unreliable in global initializers

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: 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
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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
            Reporter:
            Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: