java_posix_spawn
java_posix_spawn copied to clipboard
Possible memory allocation bug in createPrependedArgv?
This line (https://github.com/axiak/java_posix_spawn/blob/master/src/c/jlinuxfork.c#L303):
pargv[i + 1] = (char *)malloc(3 * fds[i]);
should be allocating memory that is used later to sprintf an integer representing a fd. However the amount of memory allocated seems to be wrong (3 x the actual fd number).
Perhaps that was meant to be 3 * sizeof(fds[i]) ?