mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
patch 7.4.1908
Problem: Netbeans uses uninitialzed pointer and freed memory. Solution: Set "buffer" at the right place (hint by Ken Takata)
This commit is contained in:
@@ -393,7 +393,7 @@ netbeans_parse_messages(void)
|
|||||||
if (node == NULL)
|
if (node == NULL)
|
||||||
break; /* nothing to read */
|
break; /* nothing to read */
|
||||||
|
|
||||||
/* Locate the first line in the first buffer. */
|
/* Locate the end of the first line in the first buffer. */
|
||||||
p = channel_first_nl(node);
|
p = channel_first_nl(node);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
{
|
{
|
||||||
@@ -402,9 +402,9 @@ netbeans_parse_messages(void)
|
|||||||
* prepend the text to that buffer and delete this one. */
|
* prepend the text to that buffer and delete this one. */
|
||||||
if (channel_collapse(nb_channel, PART_SOCK, TRUE) == FAIL)
|
if (channel_collapse(nb_channel, PART_SOCK, TRUE) == FAIL)
|
||||||
return;
|
return;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/* There is a complete command at the start of the buffer.
|
/* There is a complete command at the start of the buffer.
|
||||||
* Terminate it with a NUL. When no more text is following unlink
|
* Terminate it with a NUL. When no more text is following unlink
|
||||||
* the buffer. Do this before executing, because new buffers can
|
* the buffer. Do this before executing, because new buffers can
|
||||||
@@ -413,23 +413,26 @@ netbeans_parse_messages(void)
|
|||||||
if (*p == NUL)
|
if (*p == NUL)
|
||||||
{
|
{
|
||||||
own_node = TRUE;
|
own_node = TRUE;
|
||||||
channel_get(nb_channel, PART_SOCK);
|
buffer = channel_get(nb_channel, PART_SOCK);
|
||||||
|
/* "node" is now invalid! */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
own_node = FALSE;
|
own_node = FALSE;
|
||||||
|
buffer = node->rq_buffer;
|
||||||
|
}
|
||||||
|
|
||||||
/* now, parse and execute the commands */
|
/* now, parse and execute the commands */
|
||||||
nb_parse_cmd(node->rq_buffer);
|
nb_parse_cmd(buffer);
|
||||||
|
|
||||||
if (own_node)
|
if (own_node)
|
||||||
/* buffer finished, dispose of it */
|
/* buffer finished, dispose of it */
|
||||||
vim_free(node->rq_buffer);
|
vim_free(buffer);
|
||||||
else
|
else
|
||||||
/* more follows, move it to the start */
|
/* more follows, move it to the start */
|
||||||
channel_consume(nb_channel, PART_SOCK, (int)(p - buffer));
|
channel_consume(nb_channel, PART_SOCK, (int)(p - buffer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle one NUL terminated command.
|
* Handle one NUL terminated command.
|
||||||
|
@@ -753,6 +753,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1908,
|
||||||
/**/
|
/**/
|
||||||
1907,
|
1907,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user