slen = tmpl_afrom_substr(cp, &vpt, &sbuff, cp->rhs_quote,
tmpl_parse_rules_unquoted[cp->rhs_quote],
&rules);
- if (slen < 0) goto tmpl_error;
+ if (!vpt) goto tmpl_error;
if (attribute && (!tmpl_is_attr(vpt) && !tmpl_is_attr_unresolved(vpt))) {
cf_log_err(cp, "Expected attr got %s",
{
tmpl_t *vpt = *out;
+ fr_assert(vpt); /* We need something to resolve */
+
if (tmpl_resolve(vpt) < 0) {
cf_log_perr(cp, "Failed processing configuration item '%s'", cp->attr);
return -1;
/** Convert an arbitrary string into a #tmpl_t
*
* @note Unlike #tmpl_afrom_attr_str return code 0 doesn't necessarily indicate failure,
- * may just mean a 0 length string was parsed.
+ * may just mean a 0 length string was parsed. Check to see if the function emitted
+ * a #tmpl_t in *out.
*
* @note xlats and regexes are left uncompiled. This is to support the two pass parsing
* done by the modcall code. Compilation on pass1 of that code could fail, as
&(tmpl_rules_t){
.allow_unknown = true
});
- if (slen < 0) {
+ if (!vpt) {
char *spaces, *text;
fr_canonicalize_error(map->ci, &spaces, &text, slen, fr_strerror());
type,
NULL,
&parse_rules);
- if (slen < 0) {
+ if (!vpt) {
cf_log_perr(cs, "Failed parsing map");
error:
talloc_free(g);
type,
NULL,
&parse_rules);
- if (slen < 0) {
+ if (!gext->vpt) {
char *spaces, *text;
fr_canonicalize_error(cs, &spaces, &text, slen, fr_strerror());
type,
NULL,
&parse_rules);
- if (slen < 0) {
+ if (!vpt) {
char *spaces, *text;
fr_canonicalize_error(cs, &spaces, &text, slen, fr_strerror());
type,
NULL,
&parse_rules);
- if (slen <= 0) {
+ if (!vpt) {
char *spaces, *text;
fr_canonicalize_error(cs, &spaces, &text, slen, fr_strerror());
cf_pair_attr_quote(cp),
NULL,
unlang_ctx->rules);
- if (slen <= 0) {
+ if (!vpt) {
char *spaces, *text;
fr_canonicalize_error(cp, &spaces, &text, slen, fr_strerror());
type,
NULL,
&parse_rules);
- if (slen < 0) {
+ if (!gext->vpt) {
char *spaces, *text;
fr_canonicalize_error(cs, &spaces, &text, slen, fr_strerror());
slen = tmpl_afrom_substr(parent, &src_vpt,
&FR_SBUFF_IN(src, talloc_array_length(src) - 1),
cf_section_argv_quote(cs, 0), NULL, unlang_ctx->rules);
- if (slen <= 0) {
+ if (!src_vpt) {
cf_log_perr(cs, "Invalid argument to 'subrequest', failed parsing src");
error:
talloc_free(vpt);
slen = tmpl_afrom_substr(parent, &dst_vpt,
&FR_SBUFF_IN(dst, talloc_array_length(dst) - 1),
cf_section_argv_quote(cs, 1), NULL, unlang_ctx->rules);
- if (slen <= 0) {
+ if (!dst_vpt) {
cf_log_perr(cs, "Invalid argument to 'subrequest', failed parsing dst");
goto error;
}
if (!inst->program) return 0;
- slen = tmpl_afrom_substr(inst, &inst->tmpl, &FR_SBUFF_IN(inst->program, strlen(inst->program)),
+ slen = tmpl_afrom_substr(inst, &inst->tmpl,
+ &FR_SBUFF_IN(inst->program, strlen(inst->program)),
T_BACK_QUOTED_STRING, NULL,
&(tmpl_rules_t) {
.allow_foreign = true,
.allow_unresolved = false,
.allow_unknown = false
});
- if (slen <= 0) {
+ if (!inst->tmpl) {
char *spaces, *text;
fr_canonicalize_error(inst, &spaces, &text, slen, inst->program);
.allow_unresolved = false,
.at_runtime = true
});
- if (slen <= 0) {
+ if (!vpt) {
REMARKER(tmpl_str, -slen, "%s", fr_strerror());
RETURN_MODULE_FAIL;
}
&rules);
/* There was an error */
- if (slen < 0) {
+ if (!vpt) {
char *spaces, *text;
fr_canonicalize_error(ctx, &spaces, &text, slen, cp->value);
.allow_unknown = true,
.allow_unresolved = true
});
+ if (!inst->wb_domain) {
+ cf_log_perr(conf, "Bad domain");
+ wbcFreeMemory(wb_info);
+ return -1;
+ }
cf_log_err(conf, "Using winbind_domain '%s'", inst->wb_domain->name);
xlat %{myfirstxlat
match ERROR offset 13: Missing closing brace
+# Issue seen in the wild that caused an SEGV during pass2
+xlat %{%{control.IP-Pool.Name}:%{reply.IP-Pool.Range}
+match ERROR offset 25: Expected ':-' after first expansion
+
#
# API to split xlat strings into argv-style arguments.
#
match [0]{ echo }, [1]{ hello }, [2]{ %{Tmp-String-0}:1234 }, [3]{ world }
count
-match 177
+match 179