aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2026-10-15 12:07:41 +0200
committerStefano Brivio <sbrivio@redhat.com>2026-10-25 14:04:34 +0100
commit6aa4f88bd9846411edff3ed70460475b538addca (patch)
tree5616207d8e8867f357eaf80682c6a8e980123fad
parentad43e4539ab0eb3d40619f4b426ac1e1bd36b1d3 (diff)
downloadpasst-6aa4f88bd9846411edff3ed70460475b538addca.tar
passt-6aa4f88bd9846411edff3ed70460475b538addca.tar.gz
passt-6aa4f88bd9846411edff3ed70460475b538addca.tar.bz2
passt-6aa4f88bd9846411edff3ed70460475b538addca.tar.lz
passt-6aa4f88bd9846411edff3ed70460475b538addca.tar.xz
passt-6aa4f88bd9846411edff3ed70460475b538addca.tar.zst
passt-6aa4f88bd9846411edff3ed70460475b538addca.zip
passt-repair: Suppress false positive cppcheck negativeIndex warningHEADmaster
By the time we reach buf[n - 1] = '\0', n < 0 and n < sizeof(*ev) are already handled above, so the index is always positive. Add a cppcheck-suppress annotation to silence the false positive. Signed-off-by: Laurent Vivier <lvivier@redhat.com> [sbrivio: Add unmatchedSuppression for compatibility] Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--passt-repair.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/passt-repair.c b/passt-repair.c
index 80a3908..3958c3a 100644
--- a/passt-repair.c
+++ b/passt-repair.c
@@ -95,6 +95,7 @@ static int wait_for_socket(struct sockaddr_un *a, const char *dir,
continue;
}
+ /* cppcheck-suppress [negativeIndex, unmatchedSuppression] */
buf[n - 1] = '\0';
for (p = buf; p < buf + n; p += sizeof(*ev) + ev->len) {
ev = (const struct inotify_event *)p;