1
0
forked from aniani/vim

patch 8.2.3855: illegal memory access when displaying a blob

Problem:    Illegal memory access when displaying a blob.
Solution:   Append a NUL at the end. (Yegappan Lakshmanan, closes #9372)
This commit is contained in:
Yegappan Lakshmanan
2021-12-19 19:19:31 +00:00
committed by Bram Moolenaar
parent 86b3ab4fa0
commit bc404bfb32
5 changed files with 14 additions and 4 deletions

View File

@@ -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;
}