aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/spellfile.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-02-02 19:02:58 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-02-02 19:02:58 +0000
commitb255fa570d8b041e4c81e3454d51e06100c2fa4f (patch)
treed3b246b467500ca48067ed4a45d2fa53966cd9f1 /src/nvim/spellfile.c
parenteeccad2ff1ae8892fe9e06d733a7b07a166eecb0 (diff)
parent0bd07bea095a8000cffa4f379c1fa53e009c1143 (diff)
downloadrneovim-20230125_mix.tar.gz
rneovim-20230125_mix.tar.bz2
rneovim-20230125_mix.zip
Merge branch 'aucmd_textputpost' into 20230125_mix20230125_mix
Diffstat (limited to 'src/nvim/spellfile.c')
-rw-r--r--src/nvim/spellfile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c
index 44414ca1a5..7b124ae6b6 100644
--- a/src/nvim/spellfile.c
+++ b/src/nvim/spellfile.c
@@ -3855,7 +3855,7 @@ static void *getroom(spellinfo_T *spin, size_t len, bool align)
if (bl == NULL || (size_t)bl->sb_used + len > SBLOCKSIZE) {
// Allocate a block of memory. It is not freed until much later.
- bl = xcalloc(1, (sizeof(sblock_T) + SBLOCKSIZE));
+ bl = xcalloc(1, offsetof(sblock_T, sb_data) + SBLOCKSIZE + 1);
bl->sb_next = spin->si_blocks;
spin->si_blocks = bl;
bl->sb_used = 0;