Mercurial > vim
comparison src/fileio.c @ 12216:e971ef6c0dee v8.0.0988
patch 8.0.0988: warning from Covscan about using NULL pointer
commit https://github.com/vim/vim/commit/829aa64cf5a113bb683ddf8b32e483e0696602ea
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 23 22:32:35 2017 +0200
patch 8.0.0988: warning from Covscan about using NULL pointer
Problem: Warning from Covscan about using NULL pointer.
Solution: Add extra check for NULL. (zdohnal)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 23 Aug 2017 22:45:04 +0200 |
parents | 407a475c67fd |
children | 68d7bc045dbe |
comparison
equal
deleted
inserted
replaced
12215:faa2a4381b6e | 12216:e971ef6c0dee |
---|---|
1368 &did_ask_for_key); | 1368 &did_ask_for_key); |
1369 /* | 1369 /* |
1370 * Decrypt the read bytes. This is done before checking for | 1370 * Decrypt the read bytes. This is done before checking for |
1371 * EOF because the crypt layer may be buffering. | 1371 * EOF because the crypt layer may be buffering. |
1372 */ | 1372 */ |
1373 if (cryptkey != NULL && size > 0) | 1373 if (cryptkey != NULL && curbuf->b_cryptstate != NULL |
1374 && size > 0) | |
1374 { | 1375 { |
1375 if (crypt_works_inplace(curbuf->b_cryptstate)) | 1376 if (crypt_works_inplace(curbuf->b_cryptstate)) |
1376 { | 1377 { |
1377 crypt_decode_inplace(curbuf->b_cryptstate, ptr, size); | 1378 crypt_decode_inplace(curbuf->b_cryptstate, ptr, size); |
1378 } | 1379 } |