The temporary string returned by atf::env::get would be used outside its statement, which is invalid and cause undefined behavior. Copy it to a local variable to avoid the issue.
I note that we have this fixes (the same way) in freebsd-src/contrib and a couple other changes; we should probably resync some of those back to this repo. Thanks!
The temporary string returned by atf::env::get would be used outside its statement, which is invalid and cause undefined behavior. Copy it to a local variable to avoid the issue.
Fixes: https://github.com/freebsd/atf/issues/26 Fixes: https://github.com/freebsd/kyua/issues/223
Reported-by: Ruslan Bukin br@bsdpad.com