mirror of
https://github.com/vim/vim.git
synced 2025-10-02 05:04:20 -04:00
patch 8.0.0322: possible overflow with corrupted spell file
Problem: Possible overflow with spell file where the tree length is corrupted. Solution: Check for an invalid length (suggested by shqking)
This commit is contained in:
@@ -1595,6 +1595,9 @@ spell_read_tree(
|
|||||||
len = get4c(fd);
|
len = get4c(fd);
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
return SP_TRUNCERROR;
|
return SP_TRUNCERROR;
|
||||||
|
if (len >= 0x3ffffff)
|
||||||
|
/* Invalid length, multiply with sizeof(int) would overflow. */
|
||||||
|
return SP_FORMERROR;
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
/* Allocate the byte array. */
|
/* Allocate the byte array. */
|
||||||
|
@@ -764,6 +764,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 */
|
||||||
|
/**/
|
||||||
|
322,
|
||||||
/**/
|
/**/
|
||||||
321,
|
321,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user