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

Possible memory allocation bug in createPrependedArgv? #7

Open
guillerodriguez opened this issue Aug 12, 2014 · 1 comment
Open

Possible memory allocation bug in createPrependedArgv? #7

guillerodriguez opened this issue Aug 12, 2014 · 1 comment

Comments

@guillerodriguez
Copy link

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).

@guillerodriguez
Copy link
Author

Perhaps that was meant to be 3 * sizeof(fds[i]) ?

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

No branches or pull requests

1 participant