summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominique Pelle <dominique.pelle@gmail.com>2021-06-21 20:15:37 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-21 20:15:37 +0200
commitcb54bc65625abad9a0af501acac5c70fba17e2cc (patch)
tree8a77eccb36f2e2102ec2b67a947b26b618748dd6
parent035bd1c99f2a8eda5ee886adde4f97ea71fb167f (diff)
patch 8.2.3030: Coverity reports a memory leakv8.2.3030
Problem: Coverity reports a memory leak. Solution: Fix the leak and a few typos. (Dominique Pellé, closes #8418)
-rw-r--r--src/crypt.c10
-rw-r--r--src/errors.h4
-rw-r--r--src/version.c2
3 files changed, 9 insertions, 7 deletions
diff --git a/src/crypt.c b/src/crypt.c
index 35d4e14dc3..f844e4209d 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -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;
diff --git a/src/errors.h b/src/errors.h
index cb93efd907..9663ecdd69 100644
--- a/src/errors.h
+++ b/src/errors.h
@@ -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!"));
diff --git a/src/version.c b/src/version.c
index 096235fc94..0c3c887d13 100644
--- a/src/version.c
+++ b/src/version.c
@@ -756,6 +756,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3030,
+/**/
3029,
/**/
3028,