AI review of 2026-11-17_10-27-25-54fd8e469bcd-results.txt PR: #9034 https://github.com/cppcheck-opensource/cppcheck/pull/9034 Tested: 54fd8e469bcd526c35eca9d8845075a3f54f0466 Merge base: e6188446626b9e3c0cd16ffe0e49c73b18e52793 Reviewed: 2026-11-25 09:12:39 UTC Model: claude-opus-5-5 (effort high) Results: 16 reviewed of 16 in the report Verdicts: 5 improvement, 11 neutral Tokens: 34407 input, 136752 cache read, 62160 cache write, 8713 output The verdicts are written by AI and can be wrong. ---- 1 / 16 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/gdis/gdis_0.90.orig.tar.gz Result: main gdis-0.90/project.c:263:7: error: Array 'plot[50]' accessed at index 50, which is out of bounds. [arrayIndexOutOfBounds] gdis-0.90/project.c:248:8: note: Assignment 'bins=50', assigned value is 50 gdis-0.90/project.c:261:7: note: Assignment 'j=((j)>(bins-1))?(bins-1):(((j)<0)?(0):(j))', assigned value is 50 gdis-0.90/project.c:263:7: note: Array index out of bounds Explanation: The same arrayIndexOutOfBounds warning is reported by both versions. The only difference is an extra, accurate note: 'Assign plot, buffer with size 400', pointing at the g_malloc. However, the warning itself is a false positive. `j = CLAMP(j, 0, bins-1)` limits j to at most 49, so `plot[j]` cannot reach index 50. Cppcheck's claim that the clamp assigns 50 is wrong. Adding context to a false positive neither fixes nor worsens it, so the change makes no real difference to users here. ---- 2 / 16 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/gdis/gdis_0.90.orig.tar.gz Result: your gdis-0.90/project.c:263:7: error: Array 'plot[50]' accessed at index 50, which is out of bounds. [arrayIndexOutOfBounds] gdis-0.90/project.c:249:6: note: Assign plot, buffer with size 400 gdis-0.90/project.c:248:8: note: Assignment 'bins=50', assigned value is 50 gdis-0.90/project.c:261:7: note: Assignment 'j=((j)>(bins-1))?(bins-1):(((j)<0)?(0):(j))', assigned value is 50 gdis-0.90/project.c:263:7: note: Array index out of bounds Explanation: Both versions report the same warning; the PR only adds one note ('Assign plot, buffer with size 400') to the error path. That note is accurate: g_malloc(50*sizeof(gdouble)). The warning itself is a false positive in both versions. `j = CLAMP(j, 0, bins-1)` limits j to at most 49, yet Cppcheck claims the value is 50. The PR neither adds nor removes this false positive. Extra path information on a wrong warning makes no real difference to users. ---- 3 / 16 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/h/hawknl/hawknl_1.6.8+dfsg2.orig.tar.gz Result: main hawknl-1.6.8+dfsg2/src/nl.c:177:18: error: Array 'string[2]' accessed at index 255, which is out of bounds. [arrayIndexOutOfBounds] hawknl-1.6.8+dfsg2/src/nl.c:175:14: note: Assuming that condition 'i<256' is not redundant hawknl-1.6.8+dfsg2/src/nl.c:177:18: note: Array index out of bounds Explanation: Both versions report the same warning at nl.c:177. The PR only adds the value-origin notes to the error path: safecat is called with " ", which is passed into isSafeString. The warning itself is a false positive in both versions. The loop breaks as soon as it finds '\0' at index 1, so index 255 is never reached for that string. The PR does not add or remove that false positive. It makes the message more informative, because the user can now see where the 2-byte string comes from and judge the report. ---- 4 / 16 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/h/hawknl/hawknl_1.6.8+dfsg2.orig.tar.gz Result: your hawknl-1.6.8+dfsg2/src/nl.c:177:18: error: Array 'string[2]' accessed at index 255, which is out of bounds. [arrayIndexOutOfBounds] hawknl-1.6.8+dfsg2/src/nl.c:1378:40: note: Calling function 'safecat', 2nd argument '(NLchar*)" "' value is " " hawknl-1.6.8+dfsg2/src/nl.c:199:54: note: Calling function 'isSafeString', 1st argument 'src' value is " " hawknl-1.6.8+dfsg2/src/nl.c:175:14: note: Assuming that condition 'i<256' is not redundant hawknl-1.6.8+dfsg2/src/nl.c:177:18: note: Array index out of bounds Explanation: The PR does not add or remove this warning; it only adds error-path notes. The new notes show where the string value comes from: the call `safecat(..., " ")` at line 1378, then `isSafeString(src)`. That explains why Cppcheck thinks `string` has size 2. The underlying warning is still questionable, because the loop breaks at the first '\0' (index 1 for " ") and never reaches index 255. That is unchanged by the PR, though. The message itself is now more informative and lets users see the source of the size assumption. ---- 5 / 16 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/l/llama.cpp/llama.cpp_1.0.0+dfsg.orig.tar.xz Result: main llama.cpp-1.0.0/tools/server/server-http.cpp:187:38: error: Array 'value[0]' accessed at index 0, which is out of bounds. [arrayIndexOutOfBounds] Explanation: Both versions report the same false positive. `value` comes from `std::getenv`, and `value[0]` is only read after the nullptr check. A non-null C string always has at least its terminator, so index 0 is valid. Cppcheck wrongly infers a 0-sized string by reasoning backwards from the later `val.empty()` check. The PR only attaches that reasoning as error-path notes; it neither adds nor removes the warning. The notes show where the bogus inference comes from, but users still get the same false positive, so the change does not matter much either way. ---- 6 / 16 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/l/llama.cpp/llama.cpp_1.0.0+dfsg.orig.tar.xz Result: your llama.cpp-1.0.0/tools/server/server-http.cpp:187:38: error: Array 'value[0]' accessed at index 0, which is out of bounds. [arrayIndexOutOfBounds] llama.cpp-1.0.0/tools/server/server-http.cpp:191:47: note: Assuming that condition 'val.empty()' is not redundant llama.cpp-1.0.0/tools/server/server-http.cpp:190:27: note: Assignment to 'val=value' llama.cpp-1.0.0/tools/server/server-http.cpp:187:38: note: Array index out of bounds Explanation: `value` comes from `std::getenv` and is checked for nullptr before `value[0]` is read. A non-null C string always has at least its terminator, so index 0 is always in bounds. The warning is a false positive in both main and the PR. It seems to come from backward reasoning through `val.empty()`, which wrongly treats `value` as a 0-sized array. The PR only adds error-path notes to the same false positive. It neither removes nor adds a warning, so the change is cosmetic for users. The notes do expose the faulty reasoning, but the false positive itself is unchanged. ---- 7 / 16 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libs/libsavitar/libsavitar_5.3.0.orig.tar.gz Result: main libSavitar-5.3.0/tests/MeshDataTest.cpp:45:49: error: Array 'vertex_bytes[12]' accessed at index 47, which is out of bounds. [arrayIndexOutOfBounds] libSavitar-5.3.0/tests/MeshDataTest.cpp:43:37: note: Assuming that condition 'i_byte(vertices.data())` (size=12). The warning itself is a false positive in both versions. `vertices` holds 12 floats, which is 48 bytes, and `vertex_bytes` is a `uint8_t` pointer, so indices 0..47 are in bounds. Cppcheck wrongly treats the 12-element size as a 12-byte buffer. The PR only adds an error-path note showing where that wrong size came from; it neither removes nor creates the false positive. The extra note makes Cppcheck's reasoning more transparent, but the diagnostic is still wrong, so the net effect for users is essentially neutral. ---- 8 / 16 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libs/libsavitar/libsavitar_5.3.0.orig.tar.gz Result: main libSavitar-5.3.0/tests/MeshDataTest.cpp:51:45: error: Array 'face_bytes[6]' accessed at index 23, which is out of bounds. [arrayIndexOutOfBounds] libSavitar-5.3.0/tests/MeshDataTest.cpp:49:37: note: Assuming that condition 'i_byte` of 24 bytes. The loop reads bytes 0..23, which is in bounds, so the arrayIndexOutOfBounds warning is a false positive both before and after the PR. Cppcheck wrongly takes the buffer size as 6 elements instead of 24 bytes. The PR only adds an error-path note ('Assignment face_bytes=..., assigned value is size=6') to the same warning. The note does show where the wrong size comes from, but the false positive itself is unchanged, so this does not matter much to users either way. ---- 9 / 16 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libs/libsavitar/libsavitar_5.3.0.orig.tar.gz Result: your libSavitar-5.3.0/tests/MeshDataTest.cpp:45:49: error: Array 'vertex_bytes[12]' accessed at index 47, which is out of bounds. [arrayIndexOutOfBounds] libSavitar-5.3.0/tests/MeshDataTest.cpp:39:56: note: Assignment 'vertex_bytes=reinterpret_cast(vertices.data())', assigned value is size=12 libSavitar-5.3.0/tests/MeshDataTest.cpp:43:37: note: Assuming that condition 'i_byte(vertices.data())` with "size=12". The warning itself is a false positive in both versions. `vertices` holds 12 floats, which is 48 bytes, so reading `vertex_bytes[0..47]` through a `uint8_t*` stays in bounds. Cppcheck wrongly uses the element count (12) as the byte size after the reinterpret_cast. The extra note shows where that wrong size comes from, which may help a user dismiss the warning faster. However, it does not fix or worsen the false positive, and the note itself carries the incorrect size. Overall the change does not matter much to users. ---- 10 / 16 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libs/libsavitar/libsavitar_5.3.0.orig.tar.gz Result: your libSavitar-5.3.0/tests/MeshDataTest.cpp:51:45: error: Array 'face_bytes[6]' accessed at index 23, which is out of bounds. [arrayIndexOutOfBounds] libSavitar-5.3.0/tests/MeshDataTest.cpp:40:54: note: Assignment 'face_bytes=reinterpret_cast(faces.data())', assigned value is size=6 libSavitar-5.3.0/tests/MeshDataTest.cpp:49:37: note: Assuming that condition 'i_byte`, which is 24 bytes, so indexing up to 23 is valid. Cppcheck wrongly uses the element count (6) as the buffer size and ignores the `reinterpret_cast` to `uint8_t*`. Main already reported this false positive. The PR only adds a note to the error path showing where the size=6 assumption comes from. That note makes the wrong reasoning easier to see, but no warning was added or removed and the false positive remains, so the change is essentially neutral for users. ---- 11 / 16 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/n/ngetty/ngetty_1.1.orig.tar.gz Result: main ngetty-1.1/ngetty.c:75:49: error: Array 'in[9]' accessed at index 9, which is out of bounds. [arrayIndexOutOfBounds] ngetty-1.1/ngetty.c:75:18: note: Assuming that condition 'len<10' is not redundant ngetty-1.1/ngetty.c:75:49: note: Array index out of bounds Explanation: The same arrayIndexOutOfBounds warning is still reported. The PR only adds an error-path note showing that max_copy is called with "/dev/vc/", so the removed 'main' line is just the old form of that message. The warning itself is a false positive in both versions. The loop `for (len=0; len<10; len++) { if (!(out[len]=in[len])) break; }` copies the terminating NUL at index 8 and then breaks, so in[9] is never read. The extra note is accurate, but users still get the same false positive. The change does not matter either way. ---- 12 / 16 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/n/ngetty/ngetty_1.1.orig.tar.gz Result: your ngetty-1.1/ngetty.c:75:49: error: Array 'in[9]' accessed at index 9, which is out of bounds. [arrayIndexOutOfBounds] ngetty-1.1/ngetty.c:124:17: note: Calling function 'max_copy', 2nd argument '"/dev/vc/"' value is "/dev/vc/" ngetty-1.1/ngetty.c:75:18: note: Assuming that condition 'len<10' is not redundant ngetty-1.1/ngetty.c:75:49: note: Array index out of bounds Explanation: Both versions report the same warning; the PR only adds a note showing that max_copy is called with "/dev/vc/". That note is accurate, but the warning itself is a false positive. The string is 9 bytes, and the loop breaks when it copies the NUL at index 8, so in[9] is never read. The FP neither appeared nor disappeared; only its explanation got slightly more detailed, so users are not meaningfully affected. ---- 13 / 16 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/o/oce/oce_0.18.3.orig.tar.gz Result: main oce-OCE-0.18.3/src/IGESFile/structiges.c:105:57: warning: Either the condition 'lentext>=10000' is redundant or the array 'newtext[1]' is accessed at index 9999, which is out of bounds. [arrayIndexOutOfBoundsCond] oce-OCE-0.18.3/src/IGESFile/structiges.c:96:17: note: Assuming that condition 'lentext>=10000' is not redundant oce-OCE-0.18.3/src/IGESFile/structiges.c:93:32: note: Assuming condition is true oce-OCE-0.18.3/src/IGESFile/structiges.c:105:19: note: Assignment 'i=lentext-1', assigned value is 9999 oce-OCE-0.18.3/src/IGESFile/structiges.c:105:57: note: Array index out of bounds Explanation: The warning itself is unchanged and is reported by both versions. The PR only adds an error-path note: 'Calling function iges_newchar, 1st argument "" value is ""' (line 226). This note shows where the size of 'newtext[1]' comes from, which main left unexplained. The warning itself is doubtful: it likely combines the empty-string argument from one call site with the 'lentext>=10000' condition. Even so, the extra note lets users see this and judge the warning. The diagnostic became more informative, not less accurate, so this is an improvement. ---- 14 / 16 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/o/oce/oce_0.18.3.orig.tar.gz Result: your oce-OCE-0.18.3/src/IGESFile/structiges.c:105:57: warning: Either the condition 'lentext>=10000' is redundant or the array 'newtext[1]' is accessed at index 9999, which is out of bounds. [arrayIndexOutOfBoundsCond] oce-OCE-0.18.3/src/IGESFile/structiges.c:226:25: note: Calling function 'iges_newchar', 1st argument '""' value is "" oce-OCE-0.18.3/src/IGESFile/structiges.c:96:17: note: Assuming that condition 'lentext>=10000' is not redundant oce-OCE-0.18.3/src/IGESFile/structiges.c:93:32: note: Assuming condition is true oce-OCE-0.18.3/src/IGESFile/structiges.c:105:19: note: Assignment 'i=lentext-1', assigned value is 9999 oce-OCE-0.18.3/src/IGESFile/structiges.c:105:57: note: Array index out of bounds Explanation: The same arrayIndexOutOfBoundsCond warning is reported by both versions. The only difference is a new note saying the 'newtext[1]' size comes from the call at line 226, where iges_newchar is passed "". This is exactly what the PR intends: it adds the error path of the string-literal value. Before, users could not tell why 'newtext' was treated as a 1-byte array. The warning itself is likely a false positive: the "" call almost certainly passes lentext=0, which cannot meet 'lentext>=10000'. Still, the PR neither adds nor removes it. It only makes the message more traceable, so the change is a slight improvement in message accuracy. ---- 15 / 16 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/pluto-find-orb/pluto-find-orb_0.0~git20180227.orig.tar.xz Result: main pluto-find-orb/mpc_obs.cpp:1605:41: error: Array 'comment[5]' accessed at index 8, which is out of bounds. [arrayIndexOutOfBounds] Explanation: The warning itself is unchanged. Only the error path is new: it now shows where the string literal value comes from (the call comment_observation(obs, "?off") at line 3280). The underlying warning is a false positive in both versions. The loop `for( i = 0; comment[i] && i < 9; i++)` stops at the terminating NUL, so comment[8] is never read for "?off". The PR neither adds nor removes that false positive. It only makes the message more informative, which also makes it easier for a user to see that the warning is wrong. As a change in output, this is a small improvement in message quality. ---- 16 / 16 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/pluto-find-orb/pluto-find-orb_0.0~git20180227.orig.tar.xz Result: your pluto-find-orb/mpc_obs.cpp:1605:41: error: Array 'comment[5]' accessed at index 8, which is out of bounds. [arrayIndexOutOfBounds] pluto-find-orb/mpc_obs.cpp:3280:50: note: Calling function 'comment_observation', 2nd argument '"?off"' value is "?off" pluto-find-orb/mpc_obs.cpp:1605:41: note: Array index out of bounds Explanation: The PR only adds an error-path note to an existing warning. The note says comment_observation() is called with "?off" at line 3280, and that note is accurate. The warning itself is a false positive in both versions. The loop `for (i = 0; comment[i] && i < 9; i++)` checks comment[i] before the access, so for "?off" it stops at the terminator (index 4) and never reaches index 8. The same false positive is reported either way, just with extra context, so users see no real change.