diff options
author | Mike Ruprecht <mike.ruprecht@collabora.co.uk> | 2010-02-10 21:19:22 -0600 |
---|---|---|
committer | Mike Ruprecht <mike.ruprecht@collabora.co.uk> | 2010-02-11 13:18:55 -0600 |
commit | 5af87f52d8e3bf5a9f2c139512dfb184561aa5a0 (patch) | |
tree | b24c8acfa705f258a0b6aaa3451e5121d4881c53 | |
parent | b7285c90631159cc72fc3d5c5c54060bb907eb7c (diff) |
Fix a non-UTF-8 string being sent to the debug log.
In the HTTP response for a Google relay session there is a
'magic_cookie' value which contains a binary 'magic' string. This
string, contained in the entire response, was being sent to the
debug log. If Empathy's debug window was open, this would cause
that string to be sent over DBus. Since the string wasn't valid
UTF-8, DBus dropped Gabble from the session bus. This patch escapes
the binary data in that output.
-rw-r--r-- | src/jingle-factory.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/jingle-factory.c b/src/jingle-factory.c index ae3ec3de3..217c8ab48 100644 --- a/src/jingle-factory.c +++ b/src/jingle-factory.c @@ -1099,9 +1099,11 @@ on_http_response (SoupSession *soup, const gchar *relay_ssltcp_port; const gchar *username; const gchar *password; + gchar *escaped_str; - DEBUG ("Response from Google:\n====\n%s\n====", - msg->response_body->data); + escaped_str = g_strescape (msg->response_body->data, "\r\n"); + DEBUG ("Response from Google:\n====\n%s\n====", escaped_str); + g_free (escaped_str); lines = g_strsplit (msg->response_body->data, "\n", 0); |