Fix out of bound memeory access when getting HTTP response code. (#1699)

pull/1665/merge
Hadi Moshayedi 2017-10-12 12:51:42 -04:00 committed by GitHub
parent a1387f4aa8
commit 6879f92e23
1 changed files with 3 additions and 2 deletions

View File

@ -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