Repository navigation
Memory-safety analysis for C and C++ - #188
Merged
Merged
Conversation
prabhu
force-pushed
the
feat/memsafe-part1
branch
from
September 28, 2026 03:37
a06ab01 to
31adae8
Compare
…rsion 4.0.0, and reword comments to drop internal plan references
prabhu
force-pushed
the
feat/memsafe-part1
branch
from
September 28, 2026 04:03
31adae8 to
98dcdb0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A memory-safety overlay for C and C++; version 4.0.0.
MemorySemanticsPass(memory API semantics from attributes, bodies and storage),MemoryApiPass(allocator, copy and free call sites and argument roles, with a configurable inventory),ExtentPass(buffer capacities),GuardPass(what a comparison establishes),ValueOriginPass(where a length or index comes from),IntegerWidthPassandAllocationStatePass.MemorySafetyFindingPassreads those facts into theMS-*rules: bounds and copies, integer overflow into lengths, allocation state (leak, double free, use after free), null dereference, stack escape, uninitialised reads, format strings and container invalidation. A finding is reported only when the facts cannot prove the access safe, and it carries a confidence level.constvalues, macro arguments on synthetic macro calls, namespace-qualified spelling of classes named plainly, a versioned AST cache, and an opt-in macro census that finds#ifcode hidden by undefined build macros.Results on the memory-safety corpus (baseline 0%): recall 62.77% / precision 98.33% at medium confidence, 75.53% / 95.95% at low, no findings on the negative controls. FFmpeg libavformat CVE litmus: 5/13 at medium and 7/13 at low (6 and 8 with the macro census applied), with no findings at the fixed sites. leveldb and abseil were analysed with the built-in API vocabulary only.