@@ -1198,16 +1198,15 @@ void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent &Call,
1198
1198
ProgramStateRef StreamChecker::ensureGetdelimBufferAndSizeCorrect (
1199
1199
SVal LinePtrPtrSVal, SVal SizePtrSVal, const Expr *LinePtrPtrExpr,
1200
1200
const Expr *SizePtrExpr, CheckerContext &C, ProgramStateRef State) const {
1201
- static constexpr char SizeGreaterThanBufferSize[] =
1201
+ static constexpr llvm::StringLiteral SizeGreaterThanBufferSize =
1202
1202
" The buffer from the first argument is smaller than the size "
1203
1203
" specified by the second parameter" ;
1204
- static constexpr char SizeUndef[] =
1204
+ static constexpr llvm::StringLiteral SizeUndef =
1205
1205
" The buffer from the first argument is not NULL, but the size specified "
1206
1206
" by the second parameter is undefined." ;
1207
1207
1208
- auto EmitBugReport = [this , &C, SizePtrExpr,
1209
- LinePtrPtrExpr](const ProgramStateRef &BugState,
1210
- const char *ErrMsg) {
1208
+ auto EmitBugReport = [this , &C, SizePtrExpr, LinePtrPtrExpr](
1209
+ ProgramStateRef BugState, StringRef ErrMsg) {
1211
1210
if (ExplodedNode *N = C.generateErrorNode (BugState)) {
1212
1211
auto R =
1213
1212
std::make_unique<PathSensitiveBugReport>(BT_IllegalSize, ErrMsg, N);
@@ -1243,12 +1242,10 @@ ProgramStateRef StreamChecker::ensureGetdelimBufferAndSizeCorrect(
1243
1242
auto LineBufSizeGtN = SVB.evalBinOp (LinePtrNotNull, BO_GE, LineBufSize,
1244
1243
*NDefSVal, SVB.getConditionType ())
1245
1244
.getAs <DefinedOrUnknownSVal>();
1246
- if (!LineBufSizeGtN) {
1245
+ if (!LineBufSizeGtN)
1247
1246
return LinePtrNotNull;
1248
- }
1249
- if (auto LineBufSizeOk = LinePtrNotNull->assume (*LineBufSizeGtN, true )) {
1247
+ if (auto LineBufSizeOk = LinePtrNotNull->assume (*LineBufSizeGtN, true ))
1250
1248
return LineBufSizeOk;
1251
- }
1252
1249
1253
1250
EmitBugReport (LinePtrNotNull, SizeGreaterThanBufferSize);
1254
1251
return nullptr ;
0 commit comments