mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 7.4.402
Problem: Test 72 crashes under certain conditions. (Kazunobu Kuriyama) Solution: Clear the whole bufinfo_T early.
This commit is contained in:
parent
07cf382e22
commit
5a669b9481
12
src/undo.c
12
src/undo.c
@ -929,7 +929,7 @@ undo_write(bi, ptr, len)
|
|||||||
undo_flush(bi)
|
undo_flush(bi)
|
||||||
bufinfo_T *bi;
|
bufinfo_T *bi;
|
||||||
{
|
{
|
||||||
if (bi->bi_used > 0)
|
if (bi->bi_buffer != NULL && bi->bi_used > 0)
|
||||||
{
|
{
|
||||||
crypt_encode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_used);
|
crypt_encode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_used);
|
||||||
if (fwrite(bi->bi_buffer, bi->bi_used, (size_t)1, bi->bi_fp) != 1)
|
if (fwrite(bi->bi_buffer, bi->bi_used, (size_t)1, bi->bi_fp) != 1)
|
||||||
@ -1573,10 +1573,7 @@ u_write_undo(name, forceit, buf, hash)
|
|||||||
#endif
|
#endif
|
||||||
bufinfo_T bi;
|
bufinfo_T bi;
|
||||||
|
|
||||||
#ifdef FEAT_CRYPT
|
vim_memset(&bi, 0, sizeof(bi));
|
||||||
bi.bi_state = NULL;
|
|
||||||
bi.bi_buffer = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
{
|
{
|
||||||
@ -1861,6 +1858,7 @@ u_read_undo(name, hash, orig_name)
|
|||||||
#endif
|
#endif
|
||||||
bufinfo_T bi;
|
bufinfo_T bi;
|
||||||
|
|
||||||
|
vim_memset(&bi, 0, sizeof(bi));
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
{
|
{
|
||||||
file_name = u_get_undo_file_name(curbuf->b_ffname, TRUE);
|
file_name = u_get_undo_file_name(curbuf->b_ffname, TRUE);
|
||||||
@ -1905,10 +1903,6 @@ u_read_undo(name, hash, orig_name)
|
|||||||
}
|
}
|
||||||
bi.bi_buf = curbuf;
|
bi.bi_buf = curbuf;
|
||||||
bi.bi_fp = fp;
|
bi.bi_fp = fp;
|
||||||
#ifdef FEAT_CRYPT
|
|
||||||
bi.bi_state = NULL;
|
|
||||||
bi.bi_buffer = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read the undo file header.
|
* Read the undo file header.
|
||||||
|
@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
402,
|
||||||
/**/
|
/**/
|
||||||
401,
|
401,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user