{ "tokens": { "input": 33215, "cache_read": 14903, "cache_write": 12774, "output": 4736 }, "reviews": [ { "key": [ "https://ftp.debian.org/debian/pool/main/k/kytensor/kytensor_2.49.0.7.orig.tar.gz", "main kytensor-2.49.0.7/src/tracer.cc:167:47: warning: Possible null pointer dereference: current_setting [nullPointer]\n kytensor-2.49.0.7/src/tracer.cc:113:41: note: Assignment 'current_setting=nullptr', assigned value is 0\n kytensor-2.49.0.7/src/tracer.cc:115:7: note: Assuming condition is true\n kytensor-2.49.0.7/src/tracer.cc:117:12: note: Assuming condition is false\n kytensor-2.49.0.7/src/tracer.cc:165:7: note: Assuming condition is true\n kytensor-2.49.0.7/src/tracer.cc:167:47: note: Null pointer dereference" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "When `level_specified` is true and `new_setting.level_ == nullptr`, the definition `level_specified = !clear_level_ && ((current_setting != nullptr && current_setting->level_specified_) || new_setting.level_ != nullptr)` forces `current_setting != nullptr`. So the dereference at line 167 is safe and the warning was a false positive. The PR makes the analysis look through a bool to the expression it is known to equal, so Cppcheck now sees this correlation and drops the warning." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/k/kytensor/kytensor_2.49.0.7.orig.tar.gz", "main kytensor-2.49.0.7/src/tracer.cc:171:45: warning: Possible null pointer dereference: current_setting [nullPointer]\n kytensor-2.49.0.7/src/tracer.cc:113:41: note: Assignment 'current_setting=nullptr', assigned value is 0\n kytensor-2.49.0.7/src/tracer.cc:115:7: note: Assuming condition is true\n kytensor-2.49.0.7/src/tracer.cc:117:12: note: Assuming condition is false\n kytensor-2.49.0.7/src/tracer.cc:169:7: note: Assuming condition is true\n kytensor-2.49.0.7/src/tracer.cc:171:45: note: Null pointer dereference" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "`rate_specified` is true only if `new_setting.clear_rate_` is false and either `current_setting != nullptr && current_setting->rate_specified_` or `new_setting.rate_ != nullptr`. Line 171 dereferences `current_setting` only when `new_setting.rate_ == nullptr`, so `current_setting` must be non-null there. The warning was a false positive. The PR lets Cppcheck follow what the bool condition means instead of only its 0/1 range, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/l/llama.cpp/llama.cpp_1.1.0+dfsg.orig.tar.xz", "main llama.cpp-1.1.0/src/llama-kv-cache.cpp:243:84: warning:inconclusive: Possible null pointer dereference: k [nullPointer]\n llama.cpp-1.1.0/src/llama-kv-cache.cpp:233:27: note: Assuming condition 'has_k' is false\n llama.cpp-1.1.0/src/llama-kv-cache.cpp:233:33: note: Assignment 'k=has_k?ggml_new_tensor_3d(ctx,type_k,n_embd_k_gqa,kv_size,n_stream):nullptr', assigned value is 0\n llama.cpp-1.1.0/src/llama-kv-cache.cpp:243:84: note: Null pointer dereference" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "Line 243 dereferences k (k->nb[1]) only inside the true branch of 'has_k ? ... : nullptr'. k is null only when has_k is false, and that is the same condition that selects the nullptr branch. has_k is also the constant true, so k can never be null at that point. The old warning was a false positive. The PR makes stateCoversCondition handle bool conditions correctly, and the warning is now gone." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/l/llama.cpp/llama.cpp_1.1.0+dfsg.orig.tar.xz", "main llama.cpp-1.1.0/src/llama-kv-cache.cpp:243:96: warning:inconclusive: Possible null pointer dereference: k [nullPointer]\n llama.cpp-1.1.0/src/llama-kv-cache.cpp:233:27: note: Assuming condition 'has_k' is false\n llama.cpp-1.1.0/src/llama-kv-cache.cpp:233:33: note: Assignment 'k=has_k?ggml_new_tensor_3d(ctx,type_k,n_embd_k_gqa,kv_size,n_stream):nullptr', assigned value is 0\n llama.cpp-1.1.0/src/llama-kv-cache.cpp:243:96: note: Null pointer dereference" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "`has_k` is a constant `true`. Even when it was false, `k` would be nullptr only in that same case, and the dereference `k->nb[2]` at line 243 is guarded by `has_k ? ... : nullptr`. So `k` cannot be null where it is dereferenced. The warning claimed 'Assuming has_k is false' leads to null, but that path never reaches the dereference. This was a false positive. The PR makes Cppcheck use the condition a bool is known to equal, instead of its uninformative 0..1 range, so it now sees that the guard covers the dereference. Removing the warning is correct." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/l/llama.cpp/llama.cpp_1.1.0+dfsg.orig.tar.xz", "main llama.cpp-1.1.0/src/llama-kv-cache.cpp:244:84: warning:inconclusive: Possible null pointer dereference: v [nullPointer]\n llama.cpp-1.1.0/src/llama-kv-cache.cpp:234:27: note: Assuming condition 'has_v' is false\n llama.cpp-1.1.0/src/llama-kv-cache.cpp:234:33: note: Assignment 'v=has_v?ggml_new_tensor_3d(ctx,type_v,n_embd_v_gqa,kv_size,n_stream):nullptr', assigned value is 0\n llama.cpp-1.1.0/src/llama-kv-cache.cpp:244:84: note: Null pointer dereference" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "At line 244, `v->nb[1]` is only evaluated when `has_v` is true, because it sits in the true branch of `has_v ? ... : nullptr`. When `has_v` is true, `v` was assigned the result of `ggml_new_tensor_3d` on line 234, not nullptr. `has_v` is a const bool and is not modified in between. So the nullPointer warning (assuming has_v false, then dereferencing v) is a false positive. The PR makes Cppcheck use the expression a bool is known to equal when checking conditions, which lets it see that the same condition guards both the assignment and the dereference. Removing this warning is an improvement." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/l/llama.cpp/llama.cpp_1.1.0+dfsg.orig.tar.xz", "main llama.cpp-1.1.0/src/llama-kv-cache.cpp:244:96: warning:inconclusive: Possible null pointer dereference: v [nullPointer]\n llama.cpp-1.1.0/src/llama-kv-cache.cpp:234:27: note: Assuming condition 'has_v' is false\n llama.cpp-1.1.0/src/llama-kv-cache.cpp:234:33: note: Assignment 'v=has_v?ggml_new_tensor_3d(ctx,type_v,n_embd_v_gqa,kv_size,n_stream):nullptr', assigned value is 0\n llama.cpp-1.1.0/src/llama-kv-cache.cpp:244:96: note: Null pointer dereference" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "At line 244, `v->nb[2]` is only evaluated when `has_v` is true, and `v` is non-null exactly when `has_v` is true (line 234 assigns nullptr only when `has_v` is false). The loop condition `s < n_stream` must not make Cppcheck forget that the bool `has_v` carries the same information in both ternaries. The PR fixes stateCoversCondition for bools whose only known value is the impossible range: it now follows the symbolic expression the bool equals instead. Removing this false positive is an improvement." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/n/nsis/nsis_3.13.orig.tar.xz", "main nsis-3.13/Source/script.cpp:3051:25: warning: Uninitialized variable: *out_path [uninitvar]\n nsis-3.13/Source/script.cpp:3043:13: note: Assuming condition is true\n nsis-3.13/Source/script.cpp:3051:25: note: Uninitialized variable: *out_path" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "`out_path` is left uninitialized only when `badpath` is true. In that case `badpath || !*out_path` short-circuits, so `*out_path` is never read. When `badpath` is false, `my_strncpy` has already filled `out_path`. The removed uninitvar warning, which came from 'Assuming condition is true' on `badpath`, was therefore a false positive. The PR fixes exactly this case: it lets `stateCoversCondition` look through a bool variable to the expression it was initialized from, so Cppcheck now tracks the correlation correctly." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/okteta/okteta_0.26.28.orig.tar.xz", "main okteta-0.26.28/kasten/controllers/document/info/documentinfotool.cpp:99:24: warning: Possible null pointer dereference: mByteArrayModel [nullPointer]\n okteta-0.26.28/kasten/controllers/document/info/documentinfotool.cpp:91:23: note: Assuming condition 'mDocument' is false\n okteta-0.26.28/kasten/controllers/document/info/documentinfotool.cpp:91:33: note: Assignment 'mByteArrayModel=mDocument?mDocument->content():nullptr', assigned value is 0\n okteta-0.26.28/kasten/controllers/document/info/documentinfotool.cpp:97:9: note: Assuming condition is true\n okteta-0.26.28/kasten/controllers/document/info/documentinfotool.cpp:99:24: note: Null pointer dereference" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "hasDocument is (mDocument != nullptr). If hasDocument is true, mDocument is non-null, so mByteArrayModel = mDocument->content() was taken from the non-null branch of the ternary. The warning's path assumes mDocument is false and then assumes hasDocument is true, which cannot happen together. The old warning was a false positive. The PR makes Cppcheck use the bool's symbolic equivalence when checking conditions, which removes it." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/okteta/okteta_0.26.28.orig.tar.xz", "main okteta-0.26.28/kasten/gui/io/streamencoder/xxencoding/bytearrayxxencodingstreamencoder.cpp:158:33: warning: Uninitialized variable: bitsFromLastByte [uninitvar]\n okteta-0.26.28/kasten/gui/io/streamencoder/xxencoding/bytearrayxxencodingstreamencoder.cpp:119:47: note: Assuming condition is false\n okteta-0.26.28/kasten/gui/io/streamencoder/xxencoding/bytearrayxxencodingstreamencoder.cpp:157:9: note: Assuming condition is true\n okteta-0.26.28/kasten/gui/io/streamencoder/xxencoding/bytearrayxxencodingstreamencoder.cpp:158:33: note: Uninitialized variable: bitsFromLastByte" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The removed warning was a false positive. `inputByteIndex` starts as `InputByteIndex::First` before the loop. The warning's path assumes the loop at line 119 never runs, yet `hasBitsLeft` is true. If the loop never runs, `inputByteIndex` stays `First`, so `hasBitsLeft` (defined as `inputByteIndex != First`) is false and line 158 is not reached. If `inputByteIndex` is not `First`, the loop has run at least once through the `First` case, which assigns `bitsFromLastByte`. So the variable is never read uninitialized. The PR stops treating the bool's trivial range as covering the condition. It instead uses the expression the bool is known to equal, so this impossible path is correctly dropped." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/openems/openems_0.0.35+git20190103.6a75e98+dfsg.1.orig.tar.bz2", "main openems-0.0.35+git20190103.6a75e98+dfsg.1/QCSXCAD/QVTKStructure.cpp:662:29: warning: Uninitialized variable: dCoords [uninitvar]\n openems-0.0.35+git20190103.6a75e98+dfsg.1/QCSXCAD/QVTKStructure.cpp:654:29: note: Assuming condition is false\n openems-0.0.35+git20190103.6a75e98+dfsg.1/QCSXCAD/QVTKStructure.cpp:661:10: note: Assuming condition is true\n openems-0.0.35+git20190103.6a75e98+dfsg.1/QCSXCAD/QVTKStructure.cpp:662:29: note: Uninitialized variable: dCoords" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "The warning path assumes the fill loop at line 654 never runs, which only happens when nrP == 0. In that case dCoords is a zero-length VLA, and AddLinePoly is called with a point count of 0, so no uninitialized element can be read. Whenever nrP > 0, the loop writes every element before the call. The removed uninitvar warning was therefore a false positive. The PR changes how the bool condition `isCurve` is evaluated and plausibly drops this spurious path. Confidence is medium because the exact mechanism behind the removal is not fully clear." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/p/paraview/paraview_6.1.1+dfsg1.orig.tar.gz", "main Utilities/VisItBridge/databases/readers/SAS/avtSASFileFormat.C:520:34: warning:inconclusive: Possible null pointer dereference: pType [nullPointer]\n Utilities/VisItBridge/databases/readers/SAS/avtSASFileFormat.C:498:27: note: Assignment 'pType=NULL', assigned value is 0\n Utilities/VisItBridge/databases/readers/SAS/avtSASFileFormat.C:500:21: note: Assuming condition is false\n Utilities/VisItBridge/databases/readers/SAS/avtSASFileFormat.C:516:9: note: Assuming condition is true\n Utilities/VisItBridge/databases/readers/SAS/avtSASFileFormat.C:520:34: note: Null pointer dereference" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "pType is checked against NULL right after the search loop, and the NULL case calls EXCEPTION1. In VisIt this macro throws an exception, so pType cannot be NULL at line 520. The removed inconclusive warning's path relied on the unrelated bool condition at line 516 (bReadingTemp). That condition says nothing about pType. The PR changes how bool conditions are handled in stateCoversCondition, and removing this spurious path removes a false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/p/paraview/paraview_6.1.1+dfsg1.orig.tar.gz", "main Utilities/VisItBridge/databases/readers/SAS/avtSASFileFormat.C:522:23: warning:inconclusive: Possible null pointer dereference: pType [nullPointer]\n Utilities/VisItBridge/databases/readers/SAS/avtSASFileFormat.C:498:27: note: Assignment 'pType=NULL', assigned value is 0\n Utilities/VisItBridge/databases/readers/SAS/avtSASFileFormat.C:500:21: note: Assuming condition is false\n Utilities/VisItBridge/databases/readers/SAS/avtSASFileFormat.C:516:9: note: Assuming condition is true\n Utilities/VisItBridge/databases/readers/SAS/avtSASFileFormat.C:522:23: note: Null pointer dereference" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "`pType` is set to NULL and then assigned inside the search loop. If no match is found, `if (pType == NULL)` calls `EXCEPTION1(...)`, which in VisIt expands to a throw. So `pType` cannot be null at line 522, and the warning is a false positive. The warning's path also leans on the unrelated condition `bReadingTemp` at line 516. That fits the bug the PR fixes: `stateCoversCondition` misread the bool's impossible range (not <0, not >1) as known program state. With the fix that spurious path is gone, so a false positive was removed." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/p/plus42/plus42_1.5.4+ds.orig.tar.xz", "main plus42-upstream-1.5.4/common/core_globals.cc:5046:21: warning: Possible null pointer dereference: matedit_stack [nullPointer]\n plus42-upstream-1.5.4/common/core_globals.cc:5032:58: note: Assuming condition 'newdepth==0' is true\n plus42-upstream-1.5.4/common/core_globals.cc:5032:63: note: Assignment 'newstack=newdepth==0?NULL:(matedit_stack_entry*)malloc(newdepth*sizeof(matedit_stack_entry))', assigned value is 0\n plus42-upstream-1.5.4/common/core_globals.cc:5040:21: note: Assuming condition is true\n plus42-upstream-1.5.4/common/core_globals.cc:5044:33: note: Assignment 'matedit_stack=newstack', assigned value is 0\n plus42-upstream-1.5.4/common/core_globals.cc:5046:21: note: Null pointer dereference" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "When newdepth==0, newstack is NULL, but matedit_stack_depth is also set to 0, so the loop `for (i = 0; i < matedit_stack_depth; i++)` never runs and matedit_stack is never dereferenced. The removed nullPointer warning was a false positive. The note 'Assuming condition is true' at line 5040 refers to the unrelated bool matedit_is_list, which is the kind of bool-range state the PR now handles more precisely." } } ], "started": "2026-12-02 10:01:46 UTC", "runner": "pc" }