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--;