Skip to content
Snippets Groups Projects
Commit 2049b9f3 authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

iproto: log error before iproto_write_error

iproto_write_error() may reset diag (for example, if the client closes
the socket), thus invalidating the error we are going to log and leading
to a use after free bug. We must log the error before trying to send it
to the client.

The bug was introduced by commit 9b4ab9fe ("iproto: use iostream
abstraction"), which switched iproto_write_error() from plain write() to
the iostream_write(), which may set diag.

Closes #6890

NO_DOC=bug fix
NO_CHANGELOG=unreleased

(cherry picked from commit 73117059)
parent fd5da0f5
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment