OpenColorIO icon indicating copy to clipboard operation
OpenColorIO copied to clipboard

EnvExpand infinite recursion

Open dbr opened this issue 10 years ago • 0 comments

https://github.com/imageworks/OpenColorIO/blob/a557a85454ee1ffa8cb66f8a96238e079c452f08/src/core/PathUtils.cpp#L213

If an environment variable contains itself, the PathUtils.cpp EnvExpand function will recursively expand the string forever, e.g

$BLAH="aaa $BLAH bbb"

gets expanded to

aaa aaa $BLAH bbb bbb

then

aaa aaa aaa aaa $BLAH bbb bbb bbb bbb

and so on forever.

I would expect $BLAH would only get expanded once

This issue came up because we have the $SHOT context variable in the OCIOColorSpace Nuke node set to [getenv "SHOT"] - if this env var is undefined, the Tcl expression returns an error message of:

$SHOT: undefined environment variable

dbr avatar Aug 14 '15 05:08 dbr