]> granicus.if.org Git - vim/commitdiff
patch 8.2.3030: Coverity reports a memory leak v8.2.3030
authorDominique Pelle <dominique.pelle@gmail.com>
Mon, 21 Jun 2021 18:15:37 +0000 (20:15 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 21 Jun 2021 18:15:37 +0000 (20:15 +0200)
Problem:    Coverity reports a memory leak.
Solution:   Fix the leak and a few typos. (Dominique PellĂ©, closes #8418)

src/crypt.c
src/errors.h
src/version.c

index 35d4e14dc3b7767db2186dd23c3363a28b9dbc5c..f844e4209d520c08264187e759cf446ba911f081 100644 (file)
@@ -819,19 +819,19 @@ crypt_sodium_decode(
     if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES)
     {
        emsg(e_libsodium_cannot_decrypt_buffer);
-       return;
+       goto fail;
     }
     if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state,
                             buf_out, &buf_len, &tag, from, len, NULL, 0) != 0)
     {
-       emsg(e_libsodium_decription_failed);
+       emsg(e_libsodium_decryption_failed);
        goto fail;
     }
     sod_st->count++;
 
     if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last)
     {
-       emsg(e_libsodium_decyption_failed_premature);
+       emsg(e_libsodium_decryption_failed_premature);
        goto fail;
     }
     if (p1 == p2)
@@ -931,12 +931,12 @@ crypt_sodium_buffer_decode(
     if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state,
                            *buf_out, &out_len, &tag, from, len, NULL, 0) != 0)
     {
-       emsg(e_libsodium_decription_failed);
+       emsg(e_libsodium_decryption_failed);
        return -1;
     }
 
     if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last)
-       emsg(e_libsodium_decyption_failed_premature);
+       emsg(e_libsodium_decryption_failed_premature);
     return (long) out_len;
 # else
     return -1;
index cb93efd9079faf69d1268999a1a3576660f400f1..9663ecdd699e8221ab4945c23ef9feb78f963616 100644 (file)
@@ -442,7 +442,7 @@ EXTERN char e_libsodium_decryption_failed_header_incomplete[]
        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[]
+EXTERN char e_libsodium_decryption_failed[]
        INIT(= N_("E1200: Decryption failed: corrupted chunk!"));
-EXTERN char e_libsodium_decyption_failed_premature[]
+EXTERN char e_libsodium_decryption_failed_premature[]
        INIT(= N_("E1201: Decryption failed: pre-mature end of file!"));
index 096235fc940f44737c69d0c7dcc7976a029bf5ca..0c3c887d13fd202319c051287f3b50beb5eb7957 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3030,
 /**/
     3029,
 /**/