@@ -529,10 +529,9 @@ class StreamChecker : public Checker<check::PreCall, eval::Call,
529
529
ProgramStateRef ensurePtrNotNull (SVal PtrVal, const Expr *PtrExpr,
530
530
CheckerContext &C, ProgramStateRef State,
531
531
const StringRef PtrDescr) const ;
532
- ProgramStateRef
533
- ensureSizeZeroIfLineNull (SVal LinePtrPtrSVal, SVal SizePtrSVal,
534
- const Expr *LinePtrPtrExpr, const Expr *SizePtrExpr,
535
- CheckerContext &C, ProgramStateRef State) const ;
532
+ ProgramStateRef ensureGetdelimBufferAndSizeCorrect (
533
+ SVal LinePtrPtrSVal, SVal SizePtrSVal, const Expr *LinePtrPtrExpr,
534
+ const Expr *SizePtrExpr, CheckerContext &C, ProgramStateRef State) const ;
536
535
537
536
// / Generate warning about stream in EOF state.
538
537
// / There will be always a state transition into the passed State,
@@ -1218,7 +1217,7 @@ StreamChecker::ensurePtrNotNull(SVal PtrVal, const Expr *PtrExpr,
1218
1217
return PtrNotNull;
1219
1218
}
1220
1219
1221
- ProgramStateRef StreamChecker::ensureSizeZeroIfLineNull (
1220
+ ProgramStateRef StreamChecker::ensureGetdelimBufferAndSizeCorrect (
1222
1221
SVal LinePtrPtrSVal, SVal SizePtrSVal, const Expr *LinePtrPtrExpr,
1223
1222
const Expr *SizePtrExpr, CheckerContext &C, ProgramStateRef State) const {
1224
1223
static constexpr char SizeNotZeroMsg[] =
@@ -1291,10 +1290,9 @@ void StreamChecker::preGetdelim(const FnDescription *Desc,
1291
1290
if (!State)
1292
1291
return ;
1293
1292
1294
- // If `lineptr` points to a NULL pointer, `*n` must be 0.
1295
- State =
1296
- ensureSizeZeroIfLineNull (LinePtrPtrSVal, SizePtrSval, Call.getArgExpr (0 ),
1297
- Call.getArgExpr (1 ), C, State);
1293
+ State = ensureGetdelimBufferAndSizeCorrect (LinePtrPtrSVal, SizePtrSval,
1294
+ Call.getArgExpr (0 ),
1295
+ Call.getArgExpr (1 ), C, State);
1298
1296
if (!State)
1299
1297
return ;
1300
1298
0 commit comments