This is an archive of the discontinued LLVM Phabricator instance.

[MemoryLocation] strcat/strncat/strcpy read/write after their args.
ClosedPublic

Authored by fhahn on Dec 2 2021, 9:40 AM.

Details

Summary

strcpy/strcat/strncat access memory starting from the passed in
pointers. Construct memory locations for their args using getAfter.

Discussed in D114872.

Diff Detail

Event Timeline

fhahn created this revision.Dec 2 2021, 9:40 AM
fhahn requested review of this revision.Dec 2 2021, 9:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2021, 9:40 AM
xbolva00 added inline comments.Dec 2 2021, 9:55 AM
llvm/lib/Analysis/MemoryLocation.cpp
218

For strncat we can do better analysis.

GetAfter - uppearBound(N + 1)

LGTM. I agree we can refine strncat, but that can be done separately.

reames accepted this revision.Dec 2 2021, 10:52 AM
This revision is now accepted and ready to land.Dec 2 2021, 10:52 AM
This revision was landed with ongoing or failed builds.Dec 3 2021, 12:48 AM
This revision was automatically updated to reflect the committed changes.