On Tuesday, 27 December 2016 at 17:27:14 UTC, unDEFER wrote:
Hello I have very simple line with exec-command:

execl("/bin/bash".toStringz(), "/bin/bash".toStringz(), "-c".toStringz(), command.toStringz(), null);

[...]

The string is allocated on the gc-ed heap.
And since it's an R value it might get destroyed before execl is finished. Assign the result of toStringz to a char* variable and use that in the call.

Reply via email to