1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +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 GitHub
parent 328f86affc
commit 56f9ad68fb
+1 -1
View File
@@ -162,7 +162,7 @@ xfer_chat_recv_cb (const void *pointer, void *data, int fd)
{ {
ctcp_action = 0; ctcp_action = 0;
length = strlen (ptr_buf); length = strlen (ptr_buf);
if (ptr_buf[length - 1] == '\r') if ((length > 0) && (ptr_buf[length - 1] == '\r'))
{ {
ptr_buf[length - 1] = '\0'; ptr_buf[length - 1] = '\0';
length--; length--;