mirror of https://github.com/citusdata/citus.git
Fix out of bound memeory access when getting HTTP response code. (#1699)
parent
a1387f4aa8
commit
6879f92e23
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue