From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=quarantine dis=none) header.from=redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 0C03B5A0265 for ; Thu, 15 Oct 2026 12:07:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792058866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W9zFwCXqgYOreVSacFxgkWNGJNfx1J+uEUprJQaSac8=; b=Uuw+mB6uW1HVivMbkitlnHlZyI+yI0Ml6b+/5s/sxOuzBGo36tC8rAapo+raJEG7k9zCtE 2MCxPc+C1zXBDii1MeKcTiYsGCQxow4hW5NV0Jm6oRDTkGYcNcEYitFxXrJ/ciCeh2VJ/d qQcgcjBmqIrC8WsVf6LypAdHEdrzqqs= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-290-2tl0LMvrNjWkpp6Xp_7oPQ-1; Thu, 15 Oct 2026 10:07:44 +0000 X-MC-Unique: 2tl0LMvrNjWkpp6Xp_7oPQ-1 X-Mimecast-MFC-AGG-ID: 2tl0LMvrNjWkpp6Xp_7oPQ_1792058863 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8BDC5180075E for ; Thu, 15 Oct 2026 10:07:43 +0000 (UTC) Received: from lenovo-t14s.redhat.corp (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B4022195608A; Thu, 15 Oct 2026 10:07:42 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH 0/2] cppcheck 2.22.0 fixes Date: Thu, 15 Oct 2026 12:07:39 +0200 Message-ID: <20261015100741.1583455-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: CGHEE3VgBr-Npj6-fcN8d1r-sfskrdDJ7ypDxDtV8jg_1792058863 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-ID-Hash: KQQSJCSR6RHPCLCYTRO4HZ3DGAA6OK7K X-Message-ID-Hash: KQQSJCSR6RHPCLCYTRO4HZ3DGAA6OK7K X-MailFrom: lvivier@redhat.com 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: Laurent Vivier 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: Two fixes for issues detected by cppcheck 2.22.0. The first is a real simplification: a !partial_send guard in tcp_data_from_tap() is always true when reached, because partial_send causes an early return above it, so the condition is dropped. The second is a false positive: cppcheck flags buf[n - 1] as a potential negative index in passt-repair.c, not tracking that n < 0 and n < sizeof(*ev) are both handled before that point. The warning is suppressed with an annotation. Signed-off-by: Laurent Vivier Laurent Vivier (2): tcp: Drop always-true !partial_send condition in tcp_data_from_tap() passt-repair: Suppress false positive cppcheck negativeIndex warning passt-repair.c | 1 + tcp.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.56.0