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

Don't crash on large IPC control messages #119

Closed

Conversation

lucasmo
Copy link
Contributor

@lucasmo lucasmo commented Jan 6, 2017

This addresses https://dev.icinga.com/issues/13655

The issue is that IPC is done using JSON documents. When spawning an external process, the buffer containing this information (including parameters and environment variables) is limited to 4096 bytes and any further data is truncated. When the JSON is truncated, it fails to properly parse which leads to an assertion failure.

This solves the issue by sending the length of the document first, allowing the client to allocate a proper buffer and to fully read the buffer.

I was not able to test this as we rolled back our system to a previous version, but I can verify it compiles. This PR should stand as a suggestion as to how to do it. I haven't programmed in C/C++ in ~6 years so please be gentle.

@dnsmichi
Copy link
Contributor

dnsmichi commented Feb 2, 2017

Thanks a lot for your work 👍 This has been reviewed and merged to master before the GitHub migration thus being released in 2.6.1.

@dnsmichi dnsmichi closed this Feb 2, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants