Skip to content

Commit 979a387

Browse files
committed
Make the message for tainted offsets more general
1 parent 64c5ffe commit 979a387

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static std::string getTaintMsg(std::string RegName) {
279279
SmallString<128> Buf;
280280
llvm::raw_svector_ostream Out(Buf);
281281
Out << "Access of " << RegName
282-
<< " with a tainted offset that may be too large";
282+
<< " with a tainted offset that may be out of bounds";
283283
return std::string(Buf);
284284
}
285285

clang/test/Analysis/out-of-bounds-diagnostics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void taintedIndex(void) {
1818
// expected-note@-2 {{Taint propagated to the 2nd argument}}
1919
array[index] = 5;
2020
// expected-warning@-1 {{Potential out of bound access to 'array' with tainted offset}}
21-
// expected-note@-2 {{Access of 'array' with a tainted offset that may be too large}}
21+
// expected-note@-2 {{Access of 'array' with a tainted offset that may be out of bounds}}
2222
}
2323

2424
void arrayOverflow(void) {

clang/test/Analysis/taint-diagnostic-visitor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ int taintDiagnosticOutOfBound(void) {
3030
scanf("%d", &index); // expected-note {{Taint originated here}}
3131
// expected-note@-1 {{Taint propagated to the 2nd argument}}
3232
return Array[index]; // expected-warning {{Potential out of bound access to 'Array' with tainted offset}}
33-
// expected-note@-1 {{Access of 'Array' with a tainted offset that may be too large}}
33+
// expected-note@-1 {{Access of 'Array' with a tainted offset that may be out of bounds}}
3434
}
3535

3636
int taintDiagnosticDivZero(int operand) {

0 commit comments

Comments
 (0)