From: Stefano Brivio <sbrivio@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 0/2] cppcheck 2.22.0 fixes
Date: Sun, 25 Oct 2026 18:22:41 +0100 (CET) [thread overview]
Message-ID: <20261025182239.0b5ac7b0@elisabeth> (raw)
In-Reply-To: <20261015100741.1583455-1-lvivier@redhat.com>
On Thu, 15 Oct 2026 12:07:39 +0200
Laurent Vivier <lvivier@redhat.com> wrote:
> 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 <lvivier@redhat.com>
>
> Laurent Vivier (2):
> tcp: Drop always-true !partial_send condition in tcp_data_from_tap()
> passt-repair: Suppress false positive cppcheck negativeIndex warning
Applied. I added an "unmatchedSuppression" tag to the suppression in
2/2, for compatibility with older versions of Cppcheck.
--
Stefano
prev parent reply other threads:[~2026-10-25 17:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 10:07 Laurent Vivier
2026-10-15 10:07 ` [PATCH 1/2] tcp: Drop always-true !partial_send condition in tcp_data_from_tap() Laurent Vivier
2026-10-15 10:07 ` [PATCH 2/2] passt-repair: Suppress false positive cppcheck negativeIndex warning Laurent Vivier
2026-10-25 17:22 ` Stefano Brivio [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261025182239.0b5ac7b0@elisabeth \
--to=sbrivio@redhat.com \
--cc=lvivier@redhat.com \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).