To: vim_dev@googlegroups.com Subject: Patch 8.2.3030 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3030 Problem: Coverity reports a memory leak. Solution: Fix the leak and a few typos. (Dominique Pellé, closes #8418) Files: src/crypt.c, src/errors.h *** ../vim-8.2.3029/src/crypt.c 2021-06-20 14:01:25.984924607 +0200 --- src/crypt.c 2021-06-21 20:13:48.277516139 +0200 *************** *** 819,837 **** if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES) { emsg(e_libsodium_cannot_decrypt_buffer); ! return; } if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state, buf_out, &buf_len, &tag, from, len, NULL, 0) != 0) { ! emsg(e_libsodium_decription_failed); goto fail; } sod_st->count++; if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last) { ! emsg(e_libsodium_decyption_failed_premature); goto fail; } if (p1 == p2) --- 819,837 ---- if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES) { emsg(e_libsodium_cannot_decrypt_buffer); ! goto fail; } if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state, buf_out, &buf_len, &tag, from, len, NULL, 0) != 0) { ! emsg(e_libsodium_decryption_failed); goto fail; } sod_st->count++; if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last) { ! emsg(e_libsodium_decryption_failed_premature); goto fail; } if (p1 == p2) *************** *** 931,942 **** if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state, *buf_out, &out_len, &tag, from, len, NULL, 0) != 0) { ! emsg(e_libsodium_decription_failed); return -1; } if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last) ! emsg(e_libsodium_decyption_failed_premature); return (long) out_len; # else return -1; --- 931,942 ---- if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state, *buf_out, &out_len, &tag, from, len, NULL, 0) != 0) { ! emsg(e_libsodium_decryption_failed); return -1; } if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last) ! emsg(e_libsodium_decryption_failed_premature); return (long) out_len; # else return -1; *** ../vim-8.2.3029/src/errors.h 2021-06-20 14:01:25.984924607 +0200 --- src/errors.h 2021-06-21 20:13:48.277516139 +0200 *************** *** 442,448 **** INIT(= N_("E1198: Decryption failed: Header incomplete!")); EXTERN char e_libsodium_cannot_decrypt_buffer[] INIT(= N_("E1199: Cannot decrypt buffer, not enough space")); ! EXTERN char e_libsodium_decription_failed[] INIT(= N_("E1200: Decryption failed: corrupted chunk!")); ! EXTERN char e_libsodium_decyption_failed_premature[] INIT(= N_("E1201: Decryption failed: pre-mature end of file!")); --- 442,448 ---- INIT(= N_("E1198: Decryption failed: Header incomplete!")); EXTERN char e_libsodium_cannot_decrypt_buffer[] INIT(= N_("E1199: Cannot decrypt buffer, not enough space")); ! EXTERN char e_libsodium_decryption_failed[] INIT(= N_("E1200: Decryption failed: corrupted chunk!")); ! EXTERN char e_libsodium_decryption_failed_premature[] INIT(= N_("E1201: Decryption failed: pre-mature end of file!")); *** ../vim-8.2.3029/src/version.c 2021-06-21 19:43:59.146216296 +0200 --- src/version.c 2021-06-21 20:14:23.701417897 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3030, /**/ -- How To Keep A Healthy Level Of Insanity: 2. Page yourself over the intercom. Don't disguise your voice. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///