mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.3030: Coverity reports a memory leak
Problem: Coverity reports a memory leak. Solution: Fix the leak and a few typos. (Dominique Pellé, closes #8418)
This commit is contained in:
parent
035bd1c99f
commit
cb54bc6562
10
src/crypt.c
10
src/crypt.c
@ -819,19 +819,19 @@ crypt_sodium_decode(
|
|||||||
if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES)
|
if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES)
|
||||||
{
|
{
|
||||||
emsg(e_libsodium_cannot_decrypt_buffer);
|
emsg(e_libsodium_cannot_decrypt_buffer);
|
||||||
return;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state,
|
if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state,
|
||||||
buf_out, &buf_len, &tag, from, len, NULL, 0) != 0)
|
buf_out, &buf_len, &tag, from, len, NULL, 0) != 0)
|
||||||
{
|
{
|
||||||
emsg(e_libsodium_decription_failed);
|
emsg(e_libsodium_decryption_failed);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
sod_st->count++;
|
sod_st->count++;
|
||||||
|
|
||||||
if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last)
|
if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last)
|
||||||
{
|
{
|
||||||
emsg(e_libsodium_decyption_failed_premature);
|
emsg(e_libsodium_decryption_failed_premature);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (p1 == p2)
|
if (p1 == p2)
|
||||||
@ -931,12 +931,12 @@ crypt_sodium_buffer_decode(
|
|||||||
if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state,
|
if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state,
|
||||||
*buf_out, &out_len, &tag, from, len, NULL, 0) != 0)
|
*buf_out, &out_len, &tag, from, len, NULL, 0) != 0)
|
||||||
{
|
{
|
||||||
emsg(e_libsodium_decription_failed);
|
emsg(e_libsodium_decryption_failed);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last)
|
if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last)
|
||||||
emsg(e_libsodium_decyption_failed_premature);
|
emsg(e_libsodium_decryption_failed_premature);
|
||||||
return (long) out_len;
|
return (long) out_len;
|
||||||
# else
|
# else
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -442,7 +442,7 @@ EXTERN char e_libsodium_decryption_failed_header_incomplete[]
|
|||||||
INIT(= N_("E1198: Decryption failed: Header incomplete!"));
|
INIT(= N_("E1198: Decryption failed: Header incomplete!"));
|
||||||
EXTERN char e_libsodium_cannot_decrypt_buffer[]
|
EXTERN char e_libsodium_cannot_decrypt_buffer[]
|
||||||
INIT(= N_("E1199: Cannot decrypt buffer, not enough space"));
|
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!"));
|
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!"));
|
INIT(= N_("E1201: Decryption failed: pre-mature end of file!"));
|
||||||
|
@ -755,6 +755,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3030,
|
||||||
/**/
|
/**/
|
||||||
3029,
|
3029,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user