aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-web-view.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index e87416dc1..bc321549b 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -550,7 +550,7 @@ js_value_to_string (JSContextRef js_context,
g_return_val_if_fail (JSValueIsString (js_context, js_value), NULL);
str = JSValueToStringCopy (js_context, js_value, NULL);
- length = JSStringGetLength (str) + 1;
+ length = JSStringGetMaximumUTF8CStringSize (str);
buffer = g_malloc0 (length);
JSStringGetUTF8CString (str, buffer, length);