Xlats already present strings, but there can be cases where the list is
not all strings, such as LDAP map.
return -1;
}
+ /*
+ * Ensure boxes are strings before attempting to escape.
+ */
+ if (unlikely(uri_vb->type != FR_TYPE_STRING)) {
+ if (fr_value_box_cast_in_place(uri_vb, uri_vb, FR_TYPE_STRING, uri_vb->enumv) < 0) {
+ fr_strerror_printf_push("Unable to cast %pV to a string", uri_vb);
+ }
+ }
+
/*
* Tainted boxes can only belong to a single part of the URI
*/
*/
if (vb->safe == FR_VALUE_BOX_SAFE(1)) return 0;
- /*
- * Ensure the box is a string before we attempt to escape it
- */
- fr_value_box_cast_in_place(vb, vb, FR_TYPE_STRING, vb->enumv);
-
/*
* Maximum space needed for output would be 3 times the input if every
* char needed escaping