tool_help: rectify a bad assert

The condition was wrong, and now it also verifies 'tlen'.

Reported-by: Gao Liyou
Ref: #21825
Closes #21837
This commit is contained in:
Daniel Stenberg 2026-06-02 08:18:53 +02:00
parent 669e795e94
commit 7d2382ebfa
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -166,8 +166,9 @@ void inithelpscan(struct scan_ctx *ctx,
ctx->flen = strlen(arg);
ctx->endarg = endarg;
ctx->elen = strlen(endarg);
DEBUGASSERT((ctx->elen < sizeof(ctx->rbuf)) ||
(ctx->flen < sizeof(ctx->rbuf)));
DEBUGASSERT((ctx->elen < sizeof(ctx->rbuf)) &&
(ctx->flen < sizeof(ctx->rbuf)) &&
(ctx->tlen < sizeof(ctx->rbuf)));
ctx->show = 0;
ctx->olen = 0;
memset(ctx->rbuf, 0, sizeof(ctx->rbuf));