Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Blocking operations in message handler can break MessageBuffer #29

Closed
jmoo opened this issue Jul 7, 2018 · 0 comments
Closed

Blocking operations in message handler can break MessageBuffer #29

jmoo opened this issue Jul 7, 2018 · 0 comments
Milestone

Comments

@jmoo
Copy link
Contributor

jmoo commented Jul 7, 2018

onData can receive another frame before $onMessage completes and $this->messageBuffer gets null'd out, corrupting the messageBuffer.

MessageBuffer.php:99

if ($this->messageBuffer->isCoalesced()) {
    $msgCheck = $this->checkMessage($this->messageBuffer);
    if (true !== $msgCheck) {
        $onControl($this->newCloseFrame($msgCheck, 'Ratchet detected an invalid UTF-8 payload'));
    } else {
        $onMessage($this->messageBuffer);
    }

    $this->messageBuffer = null;

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

No branches or pull requests

2 participants