Merge pull request #2364 from jeffpc/openvpn
[unleashed-userland.git] / components / ekiga / patches / ekiga-08-crash-utf-8.patch
blob81189d2b68cf53fdcced687df840ee2ff13eef37
1 --- ekiga-3.2.7/lib/engine/components/opal/opal-call.cpp.orig 2013-02-18 17:53:41.055616792 +0530
2 +++ ekiga-3.2.7/lib/engine/components/opal/opal-call.cpp 2013-02-18 17:56:55.902947620 +0530
3 @@ -282,6 +282,19 @@ Opal::Call::is_outgoing () const
4 return outgoing;
7 +// if the parameter is not valid utf8, remove from it all the chars
8 +// after the first invalid utf8 char, so that it becomes valid utf8
9 +static void
10 +make_valid_utf8 (string & str)
12 + const char *pos;
13 + if (!g_utf8_validate (str.c_str(), -1, &pos)) {
14 + PTRACE (4, "Ekiga\tTrimming invalid UTF-8 string: " << str.c_str());
15 + str = str.substr (0, pos - str.c_str()).append ("...");
16 + }
21 void
22 Opal::Call::parse_info (OpalConnection & connection)
23 @@ -316,6 +329,12 @@ Opal::Call::parse_info (OpalConnection &
24 if (!app.empty ())
25 remote_application = app;
28 + make_valid_utf8 (remote_party_name);
29 + make_valid_utf8 (remote_application);
30 + make_valid_utf8 (remote_uri);
33 strip_special_chars (remote_party_name, end_special_chars, false);
34 strip_special_chars (remote_application, end_special_chars, false);
35 strip_special_chars (remote_uri, end_special_chars, false);