diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-08-23 22:32:35 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-08-23 22:32:35 +0200 |
commit | 829aa64cf5a113bb683ddf8b32e483e0696602ea (patch) | |
tree | 8b6025cfbfa43e4233fd385208e25de1d364e431 /src | |
parent | d2c45a1964ddb0d9ac16c9c985051fab41f37840 (diff) |
patch 8.0.0988: warning from Covscan about using NULL pointerv8.0.0988
Problem: Warning from Covscan about using NULL pointer.
Solution: Add extra check for NULL. (zdohnal)
Diffstat (limited to 'src')
-rw-r--r-- | src/fileio.c | 3 | ||||
-rw-r--r-- | src/undo.c | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c index f54fb84657..87a46b1b8f 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1370,7 +1370,8 @@ retry: * Decrypt the read bytes. This is done before checking for * EOF because the crypt layer may be buffering. */ - if (cryptkey != NULL && size > 0) + if (cryptkey != NULL && curbuf->b_cryptstate != NULL + && size > 0) { if (crypt_works_inplace(curbuf->b_cryptstate)) { diff --git a/src/undo.c b/src/undo.c index b913841f70..62963a995e 100644 --- a/src/undo.c +++ b/src/undo.c @@ -921,7 +921,7 @@ undo_write(bufinfo_T *bi, char_u *ptr, size_t len) static int undo_flush(bufinfo_T *bi) { - if (bi->bi_buffer != NULL && bi->bi_used > 0) + if (bi->bi_buffer != NULL && bi->bi_state != NULL && bi->bi_used > 0) { 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) diff --git a/src/version.c b/src/version.c index 6d2de86633..83cb3d9115 100644 --- a/src/version.c +++ b/src/version.c @@ -770,6 +770,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 988, +/**/ 987, /**/ 986, |