diff --git a/CHANGELOG.md b/CHANGELOG.md index 0894592f9..302c84746 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - relay: limit size of decompressed websocket frame with permessage-deflate to prevent memory exhaustion ([GHSA-v2v4-45wm-5cr3](https://github.com/weechat/weechat/security/advisories/GHSA-v2v4-45wm-5cr3)) - relay/weechat: fix empty buffers in client when WeeChat is running on Solaris/illumos - xfer: replace directory separator in remote nick by underscore in download filename to prevent writing the file outside the download directory ([#2321](https://github.com/weechat/weechat/issues/2321)) +- xfer: fix out-of-bounds read when receiving empty line in DCC chat ([#2323](https://github.com/weechat/weechat/issues/2323)) - build: fix build on Solaris/illumos (issue #2251) ## Version 4.6.3 (2025-05-11) diff --git a/src/plugins/xfer/xfer-chat.c b/src/plugins/xfer/xfer-chat.c index b9c779f47..4808356a5 100644 --- a/src/plugins/xfer/xfer-chat.c +++ b/src/plugins/xfer/xfer-chat.c @@ -160,7 +160,7 @@ xfer_chat_recv_cb (const void *pointer, void *data, int fd) { ctcp_action = 0; length = strlen (ptr_buf); - if (ptr_buf[length - 1] == '\r') + if ((length > 0) && (ptr_buf[length - 1] == '\r')) { ptr_buf[length - 1] = '\0'; length--;