Problem: Another possible overflow when reading corrupted undo file.
Solution: Check if allocated size is not too big. (King)
{
int i;
u_entry_T *uep;
- char_u **array;
+ char_u **array = NULL;
char_u *line;
int line_len;
uep->ue_size = undo_read_4c(bi);
if (uep->ue_size > 0)
{
- array = (char_u **)U_ALLOC_LINE(sizeof(char_u *) * uep->ue_size);
+ if (uep->ue_size < LONG_MAX / (int)sizeof(char_u *))
+ array = (char_u **)U_ALLOC_LINE(sizeof(char_u *) * uep->ue_size);
if (array == NULL)
{
*error = TRUE;
}
vim_memset(array, 0, sizeof(char_u *) * uep->ue_size);
}
- else
- array = NULL;
uep->ue_array = array;
for (i = 0; i < uep->ue_size; ++i)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 378,
/**/
377,
/**/