Skip to content

Environment uses putenv #5187

@aleks-f

Description

@aleks-f

Poco::Environment uses putenv, which does not copy the value, to set environment variables and holds the value in a static map. The map is protected by static mutex, but this is simply not a good idea because direct calls to system *env() are not protected by mutex.

putenv should be replaced with setenv, which makes a copy of the string. It is not guaranteed to be thread safe, but in practice it mostly is.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions