diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-07-09 13:50:41 -0400 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-07-09 13:50:41 -0400 |
commit | 8449b010aa23fb3dd6add35e228a7ae5e67a598f (patch) | |
tree | 0b8eb22debc35839020faaaf798b51a7328bf08c | |
parent | 8e520d0788fbd3b16900b354fdf403dd1ddea7eb (diff) | |
download | librest-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.c | 2 |
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; |