From: divverent Date: Fri, 22 Jun 2012 11:12:36 +0000 (+0000) Subject: uri_postbuf: copy the content-type, do not keep a reference to qc X-Git-Tag: xonotic-v0.7.0~124 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bc2ef4fbcd927b00baabcaa19c9905553b6de72c;p=xonotic%2Fdarkplaces.git uri_postbuf: copy the content-type, do not keep a reference to qc git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11830 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=1159caa1edf43936f2f006e713dc5cd4b2474992 --- diff --git a/prvm_cmds.c b/prvm_cmds.c index b3ca4bf3..e7523057 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -6075,6 +6075,7 @@ typedef struct double starttime; float id; char buffer[MAX_INPUTLINE]; + char posttype[128]; unsigned char *postdata; // free when uri_to_prog_t is freed size_t postlen; char *sigdata; // free when uri_to_prog_t is freed @@ -6234,7 +6235,8 @@ void VM_uri_get (prvm_prog_t *prog) handle->sigdata[handle->siglen] = 0; } out1: - ret = Curl_Begin_ToMemory_POST(url, handle->sigdata, 0, posttype, handle->postdata, handle->postlen, (unsigned char *) handle->buffer, sizeof(handle->buffer), uri_to_string_callback, handle); + strlcpy(handle->posttype, posttype, sizeof(handle->posttype)); + ret = Curl_Begin_ToMemory_POST(url, handle->sigdata, 0, handle->posttype, handle->postdata, handle->postlen, (unsigned char *) handle->buffer, sizeof(handle->buffer), uri_to_string_callback, handle); } else {