Skip to content

Commit f826cfc

Browse files
committed
Use field size instead of relying on null termination in posted content. Closes #180
1 parent 8a8df41 commit f826cfc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

http.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,8 @@ Datum http_request(PG_FUNCTION_ARGS)
12241224
CURL_SETOPT(g_http_handle, CURLOPT_CUSTOMREQUEST, "DELETE");
12251225
}
12261226

1227-
CURL_SETOPT(g_http_handle, CURLOPT_POSTFIELDS, text_to_cstring(content_text));
1227+
CURL_SETOPT(g_http_handle, CURLOPT_POSTFIELDS, (char *)(VARDATA(content_text)));
1228+
CURL_SETOPT(g_http_handle, CURLOPT_POSTFIELDSIZE, content_size);
12281229
}
12291230
else if ( method == HTTP_PUT || method == HTTP_PATCH || method == HTTP_UNKNOWN )
12301231
{

0 commit comments

Comments
 (0)