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:
@@ -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--;
|
||||||
|
|||||||
Reference in New Issue
Block a user