To: vim_dev@googlegroups.com Subject: Patch 8.0.0988 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0988 Problem: Warning from Covscan about using NULL pointer. Solution: Add extra check for NULL. (zdohnal) Files: src/fileio.c, src/undo.c *** ../vim-8.0.0987/src/fileio.c 2017-08-12 14:32:25.902039902 +0200 --- src/fileio.c 2017-08-23 22:11:15.236461779 +0200 *************** *** 1370,1376 **** * Decrypt the read bytes. This is done before checking for * EOF because the crypt layer may be buffering. */ ! if (cryptkey != NULL && size > 0) { if (crypt_works_inplace(curbuf->b_cryptstate)) { --- 1370,1377 ---- * Decrypt the read bytes. This is done before checking for * EOF because the crypt layer may be buffering. */ ! if (cryptkey != NULL && curbuf->b_cryptstate != NULL ! && size > 0) { if (crypt_works_inplace(curbuf->b_cryptstate)) { *** ../vim-8.0.0987/src/undo.c 2017-08-03 22:44:51.034797750 +0200 --- src/undo.c 2017-08-23 22:17:00.086272124 +0200 *************** *** 921,927 **** static int undo_flush(bufinfo_T *bi) { ! if (bi->bi_buffer != 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) --- 921,927 ---- static int undo_flush(bufinfo_T *bi) { ! 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) *** ../vim-8.0.0987/src/version.c 2017-08-22 22:28:56.054708407 +0200 --- src/version.c 2017-08-23 22:31:04.976926485 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 988, /**/ -- A)bort, R)etry, P)lease don't bother me again /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///