fix(store,lint): clean up clang-tidy warnings and uninitialized store memory - #1298
fix(store,lint): clean up clang-tidy warnings and uninitialized store memory#1298aoright wants to merge 1 commit into
Conversation
795b4e4 to
a84975c
Compare
… memory - Fix uninitialized memory allocation defect in store.c bfs_multi (malloc -> calloc) - Synchronize header parameter names with implementation in pass_lsp_cross.h - Refactor complex functions (cbm_pipeline_find_lsp_resolution, git_dirty_signature) to reduce cognitive complexity below threshold - Replace magic number array bounds with named constants from constants.h across headers and watcher Signed-off-by: aoright <102943475+aoright@users.noreply.github.com>
a84975c to
45324c2
Compare
|
Thank you for the contribution and for identifying the uninitialized traversal state while documenting the broader lint cleanup. This is now triaged as a high-priority stability bug for |
|
Thank you for this — the lint cleanup itself is legitimate and well done, and I want to be specific about what I verified before raising the one thing that needs changing. What checks out. I compared every constant substitution against The one thing I have to push back on: the "Store Defect Fix" is not a defect fix. The And if such a read did exist, Nothing here is careless, and the change is harmless — it costs a memset and nothing else. But a PR that claims to fix a memory defect sets an expectation for anyone reading the history later, and this project's convention is reproduce-first: a claimed defect comes with a test that fails without the fix. That test cannot be written here, because the defect is not there. What I would like: drop that hunk, or keep it and reclassify it honestly as defensive hardening rather than a fix. Either is fine. With that changed, this merges. One optional piece of maintainer taste, entirely your call: a few of the substitutions make the code harder to read rather than easier — One practical note: this touches |
Summary
mallocwithcallocinsrc/store/store.c(bfs_multi) forvisitedarray allocation to prevent reading uninitialized node hop memory during traversal.cbm_pipeline_lsp_target_tail_match,git_dirty_signature_submodules,git_parse_porcelain_stream) to reduce cognitive complexity of functions below threshold (25).pass_lsp_cross.h.CBM_SZ_*named constants fromconstants.hacross headers and watcher.CBM_DAEMON_SEMVER_SIZE 12Uinruntime.h.Verification
scripts/build.shsucceeded.scripts/test.shpassed 100% (6,748+ tests in 121 suites).