diff options
author | Vincent Untz <vuntz@gnome.org> | 2007-10-15 22:23:41 +0000 |
---|---|---|
committer | Vincent Untz <vuntz@src.gnome.org> | 2007-10-15 22:23:41 +0000 |
commit | 741a0ccbc770d46f9f652f950eed28f6a0efa259 (patch) | |
tree | dc6d178d2e955826fffb3c7b61925c6ccefd37d4 /libwnck | |
parent | 683558f23a1141a107fd4ef66eb2a31020b5c10e (diff) | |
download | libwnck-741a0ccbc770d46f9f652f950eed28f6a0efa259.tar.gz |
validate the strings coming from libsn so we're sure they're UTF-8. Fix
2007-10-16 Vincent Untz <vuntz@gnome.org>
* libwnck/tasklist.c: (wnck_task_get_text): validate the strings
coming from libsn so we're sure they're UTF-8.
Fix bug #476299.
svn path=/trunk/; revision=1484
Diffstat (limited to 'libwnck')
-rw-r--r-- | libwnck/tasklist.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c index 509065a..3e69139 100644 --- a/libwnck/tasklist.c +++ b/libwnck/tasklist.c @@ -3126,12 +3126,21 @@ wnck_task_get_text (WnckTask *task, case WNCK_TASK_STARTUP_SEQUENCE: #ifdef HAVE_STARTUP_NOTIFICATION name = sn_startup_sequence_get_description (task->startup_sequence); + if (name && !g_utf8_validate (name, -1, NULL)) + name = NULL; + if (name == NULL) name = sn_startup_sequence_get_name (task->startup_sequence); + if (name && !g_utf8_validate (name, -1, NULL)) + name = NULL; + if (name == NULL) name = sn_startup_sequence_get_binary_name (task->startup_sequence); + if (name && !g_utf8_validate (name, -1, NULL)) + name = NULL; - return g_strdup (name); + if (name != NULL) + return g_strdup (name); #else return NULL; #endif |