summaryrefslogtreecommitdiff
path: root/src/blob.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-12-19 19:19:31 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-19 19:19:31 +0000
commitbc404bfb32cf2bef34050d2aeae0ea72ccf980cc (patch)
tree31d8afcbb43b5cde41311e847caddcc199d42178 /src/blob.c
parent86b3ab4fa0de3e8884ab6a6ced2a70592b937d0f (diff)
downloadvim-git-bc404bfb32cf2bef34050d2aeae0ea72ccf980cc.tar.gz
patch 8.2.3855: illegal memory access when displaying a blobv8.2.3855
Problem: Illegal memory access when displaying a blob. Solution: Append a NUL at the end. (Yegappan Lakshmanan, closes #9372)
Diffstat (limited to 'src/blob.c')
-rw-r--r--src/blob.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/blob.c b/src/blob.c
index 045857118..565837052 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -240,6 +240,7 @@ blob2string(blob_T *blob, char_u **tofree, char_u *numbuf)
vim_snprintf((char *)numbuf, NUMBUFLEN, "%02X", (int)blob_get(blob, i));
ga_concat(&ga, numbuf);
}
+ ga_append(&ga, NUL); // append a NUL at the end
*tofree = ga.ga_data;
return *tofree;
}