summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2013-07-09 13:50:41 -0400
committerJasper St. Pierre <jstpierre@mecheye.net>2013-07-09 13:50:41 -0400
commit8449b010aa23fb3dd6add35e228a7ae5e67a598f (patch)
tree0b8eb22debc35839020faaaf798b51a7328bf08c
parent8e520d0788fbd3b16900b354fdf403dd1ddea7eb (diff)
downloadlibrest-8449b010aa23fb3dd6add35e228a7ae5e67a598f.tar.gz
rest-proxy-call: Use memdup, not strdup, as HTTP response data might be binary
This fixes an issue when a GSoC student was trying to fetch images from gravatar using librest.
-rw-r--r--rest/rest-proxy-call.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c
index 97ed185..c84291e 100644
--- a/rest/rest-proxy-call.c
+++ b/rest/rest-proxy-call.c
@@ -608,7 +608,7 @@ finish_call (RestProxyCall *call, SoupMessage *message, GError **error)
(SoupMessageHeadersForeachFunc)_populate_headers_hash_table,
priv->response_headers);
- priv->payload = g_strdup (message->response_body->data);
+ priv->payload = g_memdup (message->response_body->data, message->response_body->length);
priv->length = message->response_body->length;
priv->status_code = message->status_code;