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:
committed by
Bram Moolenaar
parent
86b3ab4fa0
commit
bc404bfb32
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user