From 6879f92e2305aacfcf794a6595cf17a71d4f5b85 Mon Sep 17 00:00:00 2001 From: Hadi Moshayedi Date: Thu, 12 Oct 2017 12:51:42 -0400 Subject: [PATCH] Fix out of bound memeory access when getting HTTP response code. (#1699) --- src/backend/distributed/utils/statistics_collection.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/distributed/utils/statistics_collection.c b/src/backend/distributed/utils/statistics_collection.c index 14dc6dd53..d97beb22b 100644 --- a/src/backend/distributed/utils/statistics_collection.c +++ b/src/backend/distributed/utils/statistics_collection.c @@ -182,7 +182,7 @@ SendHttpPostJsonRequest(const char *url, const char *jsonObj, long timeoutSecond curlCode = curl_easy_perform(curl); if (curlCode == CURLE_OK) { - int httpCode = 0; + int64 httpCode = 0; curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpCode); if (httpCode == 200) { @@ -191,7 +191,8 @@ SendHttpPostJsonRequest(const char *url, const char *jsonObj, long timeoutSecond else if (httpCode >= 400 && httpCode < 500) { ereport(WARNING, (errmsg("HTTP request failed."), - errhint("HTTP response code: %d", httpCode))); + errhint("HTTP response code: " INT64_FORMAT, + httpCode))); } } else