Skip to content

Commit 399c297

Browse files
committed
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)
1 parent 8cc2a9c commit 399c297

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/spellfile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,9 @@ spell_read_tree(
15951595
len = get4c(fd);
15961596
if (len < 0)
15971597
return SP_TRUNCERROR;
1598+
if (len >= 0x3ffffff)
1599+
/* Invalid length, multiply with sizeof(int) would overflow. */
1600+
return SP_FORMERROR;
15981601
if (len > 0)
15991602
{
16001603
/* Allocate the byte array. */

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
322,
767769
/**/
768770
321,
769771
/**/

0 commit comments

Comments
 (0)