Skip to content

Commit

Permalink
Use field size instead of relying on null termination in posted conte…
Browse files Browse the repository at this point in the history
…nt. Closes #180
  • Loading branch information
pramsey committed Sep 16, 2024
1 parent 8a8df41 commit f826cfc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion http.c
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,8 @@ Datum http_request(PG_FUNCTION_ARGS)
CURL_SETOPT(g_http_handle, CURLOPT_CUSTOMREQUEST, "DELETE");
}

CURL_SETOPT(g_http_handle, CURLOPT_POSTFIELDS, text_to_cstring(content_text));
CURL_SETOPT(g_http_handle, CURLOPT_POSTFIELDS, (char *)(VARDATA(content_text)));
CURL_SETOPT(g_http_handle, CURLOPT_POSTFIELDSIZE, content_size);
}
else if ( method == HTTP_PUT || method == HTTP_PATCH || method == HTTP_UNKNOWN )
{
Expand Down

0 comments on commit f826cfc

Please sign in to comment.