From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202408 header.b=BNr3Swhc; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id A6B125A004C for ; Tue, 17 Sep 2024 08:46:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202408; t=1726555562; bh=UcpUQuyj2DHteWrZXI3aMiSSYt5WlP+r817Hca4ceyg=; h=From:To:Cc:Subject:Date:From; b=BNr3SwhcdbTlYvIzdqYWKG7fqBj9t7hh68BI6l3j8rU02eqx+tYMAypBO28ZpbCem xHVs3lhn9jITH9AZHxckqrVbaeBDNu4bimb0QkH24mifQqj3XRTlgzFymMRSXgjlNr HN+bxuUTEiRSgeWyUCJcMjWTKRzyDaOfXjZWsRzvipp6fKKk36scUSX1zr6C0ydqnY O44HZS08W6qood3PkWwGySkgHYB8cYGVMgF03iQVxcXF477fxyZFXjNwW91kEibL7a mEUfFlP29ep63XEI6K8pTqgIfmUwZGdhI2PrdXLgRbSzga6m+1rfz4I9AIWrwAqTLY ZJoPXg439qdaQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4X7C3Z5LXnz4xbd; Tue, 17 Sep 2024 16:46:02 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v2 0/2] util: Fix some problems in write_remainder() Date: Tue, 17 Sep 2024 16:45:53 +1000 Message-ID: <20240917064555.1040365-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.46.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: J5BE5GLVZWBBAWOXAOGZRF2UNYOWHQ5W X-Message-ID-Hash: J5BE5GLVZWBBAWOXAOGZRF2UNYOWHQ5W X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Markus Armbruster , David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: With Markus Armbruster's help I re-examined the Coverity warning we've had in this function for a while. While I still don't understand some steps in the report it's giving, I did spot some real problems in the vicinity. It turns out fixing those also fixes the Coverity warning, so here we go. David Gibson (2): util: Add helper to write() all of a buffer util: Remove possible quadratic behaviour from write_remainder() pcap.c | 3 +-- util.c | 45 ++++++++++++++++++++++++++++++++++++--------- util.h | 1 + 3 files changed, 38 insertions(+), 11 deletions(-) -- 2.46.0