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

sendReqAck not working if ACK contains empty payload #16

Open
ghost opened this issue Feb 4, 2018 · 0 comments
Open

sendReqAck not working if ACK contains empty payload #16

ghost opened this issue Feb 4, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 4, 2018

I believe there is a bug when using sendReqAck if an empty ACK packet is received from the network.

In Sodaq_RN2483::onMacRC() if the ACK packet doesn't contain any payload the last token will be a NULL pointer and subsequently _inputBuffer[inputIndex] will fail.

I propose to add a NULL check after the last strtok and return NoError in such cases.

    // payload
    token = strtok(NULL, " "); // until end of string

    if (!token) {
        debugPrintLn("[onMacRX]: packet contains no payload.");
        return NoError;
    }
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

0 participants