Using integers or floating-point numbers could have resulted in a crash.
Use JSVAL_IS_STRING() instead of implicit conversion through
JS_ValueToString(); hopefully this will nudge the rule writer toward
thinking more about the string conversion and the format of the
resulting string.
https://bugs.freedesktop.org/show_bug.cgi?id=63575
JS_ReportError (cx, "Failed to get element %d", n);
goto out;
}
+ if (!JSVAL_IS_STRING (elem_val))
+ {
+ JS_ReportError (cx, "Element %d is not a string", n);
+ goto out;
+ }
+ s = JS_EncodeString (cx, JSVAL_TO_STRING (elem_val));
s = JS_EncodeString (cx, JSVAL_TO_STRING (elem_val));
argv[n] = g_strdup (s);
JS_free (cx, s);