AI review of 2026-11-04_13-59-28-bcaca69c7c8b-results.txt PR: #8963 https://github.com/cppcheck-opensource/cppcheck/pull/8963 Tested: bcaca69c7c8b91f44274e8076b086648d633f8bd Merge base: 1516cd2c2dc4b5a44b63576637cd53bc423dcaf1 Reviewed: 2026-11-10 11:19:08 UTC Model: claude-opus-5-5 (effort high) Results: 2 reviewed of 2 in the report Verdicts: 1 improvement, 1 regression Tokens: 3519 input, 0 cache read, 6820 cache write, 2267 output The verdicts are written by AI and can be wrong. ---- 1 / 2 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/e/ell/ell_0.83.orig.tar.xz Result: your ell-0.83/ell/dbus.c:673:17: error: Buffer is accessed out of bounds: &hdr [bufferAccessOutOfBounds] Explanation: `struct dbus_header` in ell has four `uint8_t` fields followed by an anonymous union containing the 12-byte `dbus1` struct, so its real size is 16, which equals `DBUS_HEADER_SIZE`. The `recv(fd, &hdr, DBUS_HEADER_SIZE, ...)` call is therefore in bounds. The PR handles anonymous union members as `std::max(total, n)`, but `total` already includes the preceding non-union members. That gives 12 instead of 4 + 12 = 16. The underestimated size causes this new false bufferAccessOutOfBounds. ---- 2 / 2 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/x/xen/xen_4.20.4+63-g7abfd2bce2.orig.tar.xz Result: main xen-4.20.4+63-g7abfd2bce2/tools/debugger/kdd/kdd.c:816:19: error: Array 's->txb[56]' accessed at index 271, which is out of bounds. [arrayIndexOutOfBounds] xen-4.20.4+63-g7abfd2bce2/tools/debugger/kdd/kdd.c:815:23: note: Assuming that condition 'i<0x100' is not redundant xen-4.20.4+63-g7abfd2bce2/tools/debugger/kdd/kdd.c:816:19: note: Array index out of bounds Explanation: In kdd.c, `txb` is the byte-array view of the tx packet inside an anonymous union in `kdd_state`. The code writes up to 0xffff bytes into it (see `kdd_send_string`), so the buffer is clearly much larger than 56 bytes. The dimension cppcheck reported, 56, is a wrong size computation, most likely from a `sizeof` over a struct with anonymous unions. The PR fixes `sizeof` for anonymous unions by taking the maximum member size instead of the first member, so the array size is now computed correctly and this false positive goes away.