diff --git a/include/proto/spoe.h b/include/proto/spoe.h index c840c887b..b3f7b4f8b 100644 --- a/include/proto/spoe.h +++ b/include/proto/spoe.h @@ -169,8 +169,8 @@ spoe_encode_data(struct sample *smp, char **buf, char *end) * reamining. When all the sample is encoded, the offset is reset to 0. * So the caller know it can try to encode the next sample. */ struct buffer *chk = &smp->data.u.str; - unsigned int *len = (smp->ctx.a[0] ? smp->ctx.a[0] : 0); - unsigned int *off = (smp->ctx.a[1] ? smp->ctx.a[1] : 0); + unsigned int *len = smp->ctx.a[0]; + unsigned int *off = smp->ctx.a[1]; if (!*off) { /* First evaluation of the sample : encode the diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 75854b7ae..82e271994 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -2195,8 +2195,10 @@ spoe_encode_message(struct stream *s, struct spoe_context *ctx, /* Fetch the argument value */ smp = sample_process(s->be, s->sess, s, dir|SMP_OPT_FINAL, arg->expr, NULL); - smp->ctx.a[0] = &ctx->frag_ctx.curlen; - smp->ctx.a[1] = &ctx->frag_ctx.curoff; + if (smp) { + smp->ctx.a[0] = &ctx->frag_ctx.curlen; + smp->ctx.a[1] = &ctx->frag_ctx.curoff; + } ret = spoe_encode_data(smp, buf, end); if (ret == -1 || ctx->frag_ctx.curoff) goto too_big;