Skip to content

Commit cb54bc6

Browse files
dpellebrammool
authored andcommitted
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)
1 parent 035bd1c commit cb54bc6

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/crypt.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -819,19 +819,19 @@ crypt_sodium_decode(
819819
if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES)
820820
{
821821
emsg(e_libsodium_cannot_decrypt_buffer);
822-
return;
822+
goto fail;
823823
}
824824
if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state,
825825
buf_out, &buf_len, &tag, from, len, NULL, 0) != 0)
826826
{
827-
emsg(e_libsodium_decription_failed);
827+
emsg(e_libsodium_decryption_failed);
828828
goto fail;
829829
}
830830
sod_st->count++;
831831

832832
if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last)
833833
{
834-
emsg(e_libsodium_decyption_failed_premature);
834+
emsg(e_libsodium_decryption_failed_premature);
835835
goto fail;
836836
}
837837
if (p1 == p2)
@@ -931,12 +931,12 @@ crypt_sodium_buffer_decode(
931931
if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state,
932932
*buf_out, &out_len, &tag, from, len, NULL, 0) != 0)
933933
{
934-
emsg(e_libsodium_decription_failed);
934+
emsg(e_libsodium_decryption_failed);
935935
return -1;
936936
}
937937

938938
if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last)
939-
emsg(e_libsodium_decyption_failed_premature);
939+
emsg(e_libsodium_decryption_failed_premature);
940940
return (long) out_len;
941941
# else
942942
return -1;

src/errors.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ EXTERN char e_libsodium_decryption_failed_header_incomplete[]
442442
INIT(= N_("E1198: Decryption failed: Header incomplete!"));
443443
EXTERN char e_libsodium_cannot_decrypt_buffer[]
444444
INIT(= N_("E1199: Cannot decrypt buffer, not enough space"));
445-
EXTERN char e_libsodium_decription_failed[]
445+
EXTERN char e_libsodium_decryption_failed[]
446446
INIT(= N_("E1200: Decryption failed: corrupted chunk!"));
447-
EXTERN char e_libsodium_decyption_failed_premature[]
447+
EXTERN char e_libsodium_decryption_failed_premature[]
448448
INIT(= N_("E1201: Decryption failed: pre-mature end of file!"));

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3030,
758760
/**/
759761
3029,
760762
/**/

0 commit comments

Comments
 (0)