summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-08-23 22:32:35 +0200
committerBram Moolenaar <Bram@vim.org>2017-08-23 22:32:35 +0200
commit829aa64cf5a113bb683ddf8b32e483e0696602ea (patch)
tree8b6025cfbfa43e4233fd385208e25de1d364e431 /src/fileio.c
parentd2c45a1964ddb0d9ac16c9c985051fab41f37840 (diff)
downloadvim-git-829aa64cf5a113bb683ddf8b32e483e0696602ea.tar.gz
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/fileio.c')
-rw-r--r--src/fileio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index f54fb8465..87a46b1b8 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))
{