tcpdump/0011-Evp-cipher-buffers.patch
Michal Ruprich 40612b3036 New version 4.9.3
Fixes CVE-2017-16808, CVE-2018-14468, CVE-2018-14469, CVE-2018-14470, CVE-2018-14466, CVE-2018-14461, CVE-2018-14462, CVE-2018-14465, CVE-2018-14881, CVE-2018-14464, CVE-2018-14463, CVE-2018-14467, CVE-2018-10103, CVE-2018-10105, CVE-2018-14880, CVE-2018-16451, CVE-2018-14882, CVE-2018-16227, CVE-2018-16229, CVE-2018-16301, CVE-2018-16230, CVE-2018-16452, CVE-2018-16300, CVE-2018-16228, CVE-2019-15166, CVE-2019-15167
2019-10-15 15:06:02 +02:00

30 lines
1.0 KiB
Diff

diff --git a/print-esp.c b/print-esp.c
index 6fabff1..5818cc8 100644
--- a/print-esp.c
+++ b/print-esp.c
@@ -242,6 +242,7 @@ int esp_print_decrypt_buffer_by_ikev2(netdissect_options *ndo,
if (input_buffer == NULL) {
EVP_CIPHER_CTX_free(ctx);
(*ndo->ndo_error)(ndo, "can't allocate memory for encrypted data buffer");
+ return 0;
}
/*
* Copy the input data to the encrypted data buffer, and pad it
@@ -259,7 +260,7 @@ int esp_print_decrypt_buffer_by_ikev2(netdissect_options *ndo,
EVP_CIPHER_CTX_free(ctx);
(*ndo->ndo_error)(ndo, "can't allocate memory for decryption buffer");
}
- EVP_Cipher(ctx, output_buffer, input_buffer, len);
+ EVP_Cipher(ctx, output_buffer, input_buffer, buffer_size);
EVP_CIPHER_CTX_free(ctx);
/*
@@ -815,6 +816,7 @@ esp_print(netdissect_options *ndo,
if (input_buffer == NULL) {
EVP_CIPHER_CTX_free(ctx);
(*ndo->ndo_error)(ndo, "can't allocate memory for encrypted data buffer");
+ return 0;
}
/*
* Copy the input data to the encrypted data buffer,