summaryrefslogtreecommitdiff
path: root/src/spellfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/spellfile.c')
-rw-r--r--src/spellfile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/spellfile.c b/src/spellfile.c
index 8b1a3a633..00ef019a6 100644
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -1585,7 +1585,7 @@ spell_read_tree(
int prefixtree, /* TRUE for the prefix tree */
int prefixcnt) /* when "prefixtree" is TRUE: prefix count */
{
- int len;
+ long len;
int idx;
char_u *bp;
idx_T *ip;
@@ -1595,7 +1595,7 @@ spell_read_tree(
len = get4c(fd);
if (len < 0)
return SP_TRUNCERROR;
- if (len >= 0x3ffffff)
+ if (len >= LONG_MAX / (long)sizeof(int))
/* Invalid length, multiply with sizeof(int) would overflow. */
return SP_FORMERROR;
if (len > 0)