diff --git a/src/flt_spoe.c b/src/flt_spoe.c index a7d6bb950..703d6ba96 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -2287,7 +2287,9 @@ spoe_encode_messages(struct stream *s, struct spoe_context *ctx, return 1; too_big: - if (!(agent->flags & SPOE_FL_SND_FRAGMENTATION)) { + /* Return an error if fragmentation is unsupported or if nothing has + * been encoded because its too big and not splittable. */ + if (!(agent->flags & SPOE_FL_SND_FRAGMENTATION) || p == b_head(&ctx->buffer)) { ctx->status_code = SPOE_CTX_ERR_TOO_BIG; return -1; }