mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
browser-plugin: Use g_strndup to get a string property
WebKit-based browsers like Chromium and Epiphany may insert extra junk at the end of NPStrings, so we cannot depend on the strlen matching. https://bugzilla.gnome.org/show_bug.cgi?id=663823
This commit is contained in:
parent
2c2729f7be
commit
9bc1a68fe4
1 changed files with 1 additions and 4 deletions
|
|
@ -71,10 +71,7 @@ get_string_property (NPP instance,
|
|||
goto out;
|
||||
|
||||
result_str = NPVARIANT_TO_STRING (result);
|
||||
if (strlen (result_str.UTF8Characters) != result_str.UTF8Length)
|
||||
goto out;
|
||||
|
||||
result_copy = g_strdup (result_str.UTF8Characters);
|
||||
result_copy = g_strndup (result_str.UTF8Characters, result_str.UTF8Length);
|
||||
|
||||
out:
|
||||
funcs.releasevariantvalue (&result);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue