Commit f54818c
authored
Bug fix: reset io_last_written on c->buf resize to prevent stale pointers (valkey-io#2786)
Fixes an assert crash in _writeToClient():
serverAssert(c->io_last_written.data_len == 0 ||
c->io_last_written.buf == c->buf);
The issue occurs when clientsCronResizeOutputBuffer() grows or
reallocates c->buf while io_last_written still points to the old buffer
and data_len is non-zero. On the next write, both conditions in the
assertion become false.
Reset io_last_written when resizing the output buffer to prevent stale
pointers and keep state consistent.
fixes valkey-io#2769
Signed-off-by: xbasel <103044017+xbasel@users.noreply.github.com>1 parent 864de55 commit f54818c
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
987 | 987 | | |
988 | 988 | | |
989 | 989 | | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
990 | 993 | | |
991 | 994 | | |
992 | 995 | | |
| |||
0 commit comments