From 8b27dfdfb07d532cd7e38dc9f9b4b48a5cab9958 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 3 Feb 2026 07:56:02 +0100 Subject: [PATCH] MEDIUM: applet: Disable 0-copy for buffers of different size Just like the previous commit, we must take care to never swap buffers of different size when data are exchanged between an applet and a SC. it will be mandatory when the large buffers support on channels will be added. --- src/applet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applet.c b/src/applet.c index 0e4ecf69d..7b08539a3 100644 --- a/src/applet.c +++ b/src/applet.c @@ -505,7 +505,7 @@ size_t appctx_htx_rcv_buf(struct appctx *appctx, struct buffer *buf, size_t coun ret = appctx_htx->data; buf_htx = htx_from_buf(buf); - if (htx_is_empty(buf_htx) && htx_used_space(appctx_htx) <= count) { + if (b_size(&appctx->outbuf) == b_size(buf) && htx_is_empty(buf_htx) && htx_used_space(appctx_htx) <= count) { htx_to_buf(buf_htx, buf); htx_to_buf(appctx_htx, &appctx->outbuf); b_xfer(buf, &appctx->outbuf, b_data(&appctx->outbuf));