From 68bf982b6f5b1d0cc1a35f313bd244f162ffdc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Wed, 24 Jan 2024 19:13:22 +0100 Subject: [PATCH] Fix use after free in DRMProcessorClientImpl::sendHTTPRequest() --- include/libgourou.h | 2 +- utils/drmprocessorclientimpl.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/libgourou.h b/include/libgourou.h index b86c449..cb24a87 100644 --- a/include/libgourou.h +++ b/include/libgourou.h @@ -37,7 +37,7 @@ #define ACS_SERVER "http://adeactivate.adobe.com/adept" #endif -#define LIBGOUROU_VERSION "0.8.4" +#define LIBGOUROU_VERSION "0.8.5" namespace gourou { diff --git a/utils/drmprocessorclientimpl.cpp b/utils/drmprocessorclientimpl.cpp index 1019eaf..58a9f97 100644 --- a/utils/drmprocessorclientimpl.cpp +++ b/utils/drmprocessorclientimpl.cpp @@ -298,14 +298,15 @@ std::string DRMProcessorClientImpl::sendHTTPRequest(const std::string& URL, cons } curl_slist_free_all(list); + + long http_code = 400; + curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code); + curl_easy_cleanup(curl); if (res != CURLE_OK) EXCEPTION(gourou::CLIENT_NETWORK_ERROR, "Error " << curl_easy_strerror(res)); - long http_code = 400; - curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code); - if (http_code >= 400) EXCEPTION(gourou::CLIENT_HTTP_ERROR, "HTTP Error code " << http_code);