]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_help: rectify a bad assert
authorDaniel Stenberg <daniel@haxx.se>
Tue, 2 Jun 2026 06:18:53 +0000 (08:18 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 2 Jun 2026 06:45:48 +0000 (08:45 +0200)
The condition was wrong, and now it also verifies 'tlen'.

Reported-by: Gao Liyou
Ref: #21825
Closes #21837

src/tool_help.c

index 212972f382480a5a65f6cb44427da24c5d7b02a2..c9d76d5d2072e779ff555b668a39949245efc9ac 100644 (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));