Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions svf/include/AE/Svfexe/AbstractInterpretation.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ class AbstractInterpretation

void updateStateOnBinary(const BinaryOPStmt *binary);

IntervalValue comparePointerValues(const CmpStmt *cmp,
const AbstractValue& lhsValue,
const AbstractValue& rhsValue) const;

void updateStateOnCmp(const CmpStmt *cmp);

void updateStateOnLoad(const LoadStmt *load);
Expand Down
3 changes: 3 additions & 0 deletions svf/lib/AE/Svfexe/AEDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ bool BufOverflowDetector::canSafelyAccessMemory(const SVF::ValVar* value, const
}
for (const auto& addr : ptrVal.getAddrs())
{
// Null cannot safely access a backing memory object.
if (AbstractState::isNullMem(addr))
return false;
NodeID objId = ae.getAbsState(node).getIDFromAddr(addr);
u32_t size = 0;
// if the object is a constant size object, get the size directly
Expand Down
11 changes: 5 additions & 6 deletions svf/lib/AE/Svfexe/AbsExtAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,9 @@ void AbsExtAPI::initExtFunMap()
const AbstractValue& ptrVal = ae->getAbsValue(callNode->getArgument(0), callNode);
for (auto addr: ptrVal.getAddrs())
{
if (AbstractState::isBlackHoleObjAddr(addr))
{
}
else
{
if (!AbstractState::isBlackHoleObjAddr(addr) &&
!AbstractState::isNullMem(addr))
as.addToFreedAddrs(addr);
}
}
};
// Add all free-related functions to func_map
Expand Down Expand Up @@ -455,6 +451,9 @@ IntervalValue AbsExtAPI::getStrlen(const ValVar *strValue, const ICFGNode* node)
const AbstractValue& ptrVal = ae->getAbsValue(strValue, node);
for (const auto& addr : ptrVal.getAddrs())
{
// Null has no backing buffer whose size can be inspected.
if (AbstractState::isNullMem(addr))
continue;
NodeID objId = as.getIDFromAddr(addr);
if (svfir->getBaseObject(objId)->isConstantByteSize())
{
Expand Down
Loading
Loading