public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: passt-dev@passt.top
Cc: Laurent Vivier <lvivier@redhat.com>
Subject: [PATCH 0/2] cppcheck 2.22.0 fixes
Date: Thu, 15 Oct 2026 12:07:39 +0200	[thread overview]
Message-ID: <20261015100741.1583455-1-lvivier@redhat.com> (raw)

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

 passt-repair.c | 1 +
 tcp.c          | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

-- 
2.56.0


             reply	other threads:[~2026-10-15 10:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 10:07 Laurent Vivier [this message]
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

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=20261015100741.1583455-1-lvivier@redhat.com \
    --to=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).