public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH 0/2] cppcheck 2.22.0 fixes
@ 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
  0 siblings, 2 replies; 3+ messages in thread
From: Laurent Vivier @ 2026-10-15 10:07 UTC (permalink / raw)
  To: passt-dev; +Cc: Laurent Vivier

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-15 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-15 10:07 [PATCH 0/2] cppcheck 2.22.0 fixes 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

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).