1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 07:46:38 +02:00

xfer: fix out-of-bounds read in xfer_chat_recv_cb on empty line (#2323)

This commit is contained in:
aizu-m
2026-06-06 10:31:18 +05:30
committed by Sébastien Helleu
parent 30529057c8
commit f91f92b48f
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -162,7 +162,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--;