That's a fix on top of D49722.
Both strlcat and strlcpy cut off their safe bound argument value at sizeof(destination). There's no need to subtract 1 in one of these cases.
Paths
| Differential D57981
[analyzer] strlcat() syntax check: Fix an off-by-one error. ClosedPublic Authored by NoQ on Feb 8 2019, 3:01 PM.
Details
Summary That's a fix on top of D49722. Both strlcat and strlcpy cut off their safe bound argument value at sizeof(destination). There's no need to subtract 1 in one of these cases.
Diff Detail Event TimelineThis revision is now accepted and ready to land.Feb 8 2019, 3:23 PM Closed by commit rL353583: [analyzer] CStringSyntaxChecks: Fix an off-by-one error in the strlcat() check. (authored by NoQ). · Explain WhyFeb 8 2019, 3:59 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 186049 lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp
test/Analysis/cstring-syntax.c
|