From 56f9ad68fbc39c5080750a1b347d727f8d813a45 Mon Sep 17 00:00:00 2001 From: aizu-m Date: Sat, 6 Jun 2026 10:31:18 +0530 Subject: [PATCH] xfer: fix out-of-bounds read in xfer_chat_recv_cb on empty line (#2323) --- src/plugins/xfer/xfer-chat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/xfer/xfer-chat.c b/src/plugins/xfer/xfer-chat.c index 7473af826..d33e8db2a 100644 --- a/src/plugins/xfer/xfer-chat.c +++ b/src/plugins/xfer/xfer-chat.c @@ -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--;