From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29336 invoked from network); 11 Nov 2020 21:26:46 -0000 Received: from krantz.zx2c4.com (192.95.5.69) by inbox.vuxu.org with ESMTPUTF8; 11 Nov 2020 21:26:46 -0000 Received: by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 364f6518; Wed, 11 Nov 2020 21:22:47 +0000 (UTC) Return-Path: Received: from mx.mylinuxtime.de (mx.mylinuxtime.de [195.201.174.144]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTPS id db291754 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 11 Nov 2020 21:22:45 +0000 (UTC) Received: from leda.eworm.de (p54b796fb.dip0.t-ipconnect.de [84.183.150.251]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx.mylinuxtime.de (Postfix) with ESMTPSA id 3DEC214F04A; Wed, 11 Nov 2020 22:20:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eworm.de; s=mail; t=1605129641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=szy9W+zijtIKgKDw1p8BNZBut0IHhSN/7OhQVG+tS9Y=; b=iVJ7HKmF3sDmrrv10kelTy8zpdp6QGMSZWvCuJyZGITa7JVvHHLzPOmD52b+SAP9LtSjWc LSNH3EwDvO3IGEq/aQFU73LWsX48kHhHej1Smb58nYmdtk/45gW+AKKSxtW4sOG1q8MTbg SPotYrsRaKEWsXnUvaQjtOi6+WeYXGw= Received: by leda.eworm.de (Postfix, from userid 1000) id 83F241A12B5; Wed, 11 Nov 2020 22:20:10 +0100 (CET) From: Christian Hesse To: cgit@lists.zx2c4.com Cc: Peter Prohaska , Christian Hesse Subject: [PATCH 1/1] html: fix handling of null byte Date: Wed, 11 Nov 2020 22:19:59 +0100 Message-Id: <20201111211959.22841-1-list@eworm.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: mx.mylinuxtime.de; auth=pass smtp.auth=smtp-only@eworm.de smtp.mailfrom=eworm@leda.eworm.de X-Rspamd-Server: mx X-Stat-Signature: mpyoy9a7ktijr3t6xzib8853wwxwfoif X-Rspamd-Queue-Id: 3DEC214F04A X-Spamd-Result: default: False [-1.67 / 15.00]; ARC_NA(0.00)[]; GENERIC_REPUTATION(0.00)[-0.83735369276246]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_MISSING_CHARSET(2.50)[]; FREEMAIL_ENVRCPT(0.00)[web.de]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-2.98)[-0.994]; DKIM_SIGNED(0.00)[]; NEURAL_HAM_SHORT(-0.89)[-0.888]; MID_CONTAINS_FROM(1.00)[]; FORGED_SENDER(0.30)[list@eworm.de,eworm@leda.eworm.de]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:3320, ipnet:84.128.0.0/10, country:DE]; FROM_NEQ_ENVFROM(0.00)[list@eworm.de,eworm@leda.eworm.de]; BAYES_HAM(-3.00)[100.00%]; FREEMAIL_CC(0.00)[web.de,eworm.de] X-BeenThere: cgit@lists.zx2c4.com X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: List for cgit developers and users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cgit-bounces@lists.zx2c4.com Sender: "CGit" From: Peter Prohaska A return value of `len` or more means that the output was truncated. Signed-off-by: Peter Prohaska Signed-off-by: Christian Hesse --- html.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html.c b/html.c index 7f81965..0bac34b 100644 --- a/html.c +++ b/html.c @@ -59,7 +59,7 @@ char *fmt(const char *format, ...) va_start(args, format); len = vsnprintf(buf[bufidx], sizeof(buf[bufidx]), format, args); va_end(args); - if (len > sizeof(buf[bufidx])) { + if (len >= sizeof(buf[bufidx])) { fprintf(stderr, "[html.c] string truncated: %s\n", format); exit(1); }