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

MIssing check for malformed UDP packet #8

Closed
rlam1 opened this issue Jan 23, 2017 · 1 comment
Closed

MIssing check for malformed UDP packet #8

rlam1 opened this issue Jan 23, 2017 · 1 comment

Comments

@rlam1
Copy link
Owner

rlam1 commented Jan 23, 2017

MessageParser.cpp on Network\ has a function ParsePacket(...) which is responsible for the correct parsing of all incoming UDP packets directly from the buffer.

The first check it does is to determine that the buffer contains at least one segment of data:

int rows_received = (bytesReceived - headerSize) / structSize;
    if (rows_received < 1) {
        status = 1;
        return;
}

This check can successfully bail out of processing when a packet too small is received.

However there is no check in place when an impossibly huge packet is received. X-Plane has a finite amount of data that can be sent at a time from a single packet. This size could be determined and added to the code as an additional check.

The program will then bail out of processing a too big packet.

@rlam1 rlam1 added the bug label Jan 23, 2017
@rlam1 rlam1 added this to the Display DataRefs on a screen milestone Jan 23, 2017
@rlam1
Copy link
Owner Author

rlam1 commented Apr 3, 2017

commit a49690b took care of this bug.

@rlam1 rlam1 closed this as completed Apr 3, 2017
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

1 participant