Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
L
libao
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 32
    • Issues 32
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 3
    • Merge Requests 3
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Xiph.Org
  • libao
  • Issues
  • #701

Closed
Open
Opened Sep 06, 2005 by thekingant@thekingant

[PATCH] Autodetection of esd can trash environment variables, leading to a crash of the application using libao

The ao_plugin_text() function in src/plugins/esd/ao_esd.c adds an environment variable using putenv(). The putenv() function uses the reference that is passed to it. This is fine, until ao_shutdown() is called and the ao esd plugin is unloaded, at which point the reference passed to putenv() becomes invalid and future calls to getenv() may cause a crash.

I'm experiencing this in Gaim CVS, where we've moved our call to ao_shutdown() to be earlier in our shutdown process, and we have calls to gettext afterwards which call getenv() which causes a crash.

The best solution for this is to call unsetenv() to unset the ESD_NO_SPAWN environment variable. I think you could also go back to using setenv, which looks like it makes a copy of the data passed to it (although it seems to be less portable). However, it's probably better to not set that environment variable in the parent's process.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: xiph/libao#701