Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestSuiteRunner.c uses system(), should use posix_spawn() instead #30

Closed
jmcp opened this issue Aug 17, 2017 · 1 comment
Closed

TestSuiteRunner.c uses system(), should use posix_spawn() instead #30

jmcp opened this issue Aug 17, 2017 · 1 comment

Comments

@jmcp
Copy link

jmcp commented Aug 17, 2017

While examining the odpi source in preparation for creating an IPS packaged version, I came across the test suite's TestSuiteRunner.c file, which contains these lines:

 98     // run executable and return success only if all tests pass
 99     result = system(executableName);

This violates https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=2130132, aka " ENV33-C. Do not call system()".

The posix_spawn() function (see http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html) is available on Linux, Mac osx, Solaris and other UNIX-like systems. For MS Windows, one of the functions noted at https://en.wikipedia.org/wiki/Spawn_(computing) would be preferable.

@anthony-tuininga
Copy link
Member

Thanks, @jmcp. I've added the code to use posix_spawn(), as suggested. The Windows code was already using CreateProcess() so it should be fine as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants