aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/taint-generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/taint-generic.c')
-rw-r--r--test/Analysis/taint-generic.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/Analysis/taint-generic.c b/test/Analysis/taint-generic.c
index d52dcda5a1..b00372a3ff 100644
--- a/test/Analysis/taint-generic.c
+++ b/test/Analysis/taint-generic.c
@@ -111,11 +111,11 @@ void testTaintSystemCall() {
char buffer[156];
char addr[128];
scanf("%s", addr);
- system(addr); // expected-warning {{Tainted data passed to a system call}}
+ system(addr); // expected-warning {{Untrusted data is passed to a system call}}
// Test that spintf transfers taint.
sprintf(buffer, "/bin/mail %s < /tmp/email", addr);
- system(buffer); // expected-warning {{Tainted data passed to a system call}}
+ system(buffer); // expected-warning {{Untrusted data is passed to a system call}}
}
void testTaintSystemCall2() {
@@ -124,7 +124,7 @@ void testTaintSystemCall2() {
char addr[128];
scanf("%s", addr);
__builtin_snprintf(buffern, 10, "/bin/mail %s < /tmp/email", addr);
- system(buffern); // expected-warning {{Tainted data passed to a system call}}
+ system(buffern); // expected-warning {{Untrusted data is passed to a system call}}
}
void testTaintSystemCall3() {
@@ -133,20 +133,20 @@ void testTaintSystemCall3() {
char addr[128];
scanf("%s %d", addr, &numt);
__builtin_snprintf(buffern2, numt, "/bin/mail %s < /tmp/email", "abcd");
- system(buffern2); // expected-warning {{Tainted data passed to a system call}}
+ system(buffern2); // expected-warning {{Untrusted data is passed to a system call}}
}
void testTaintedBufferSize() {
size_t ts;
scanf("%zd", &ts);
- int *buf1 = (int*)malloc(ts*sizeof(int)); // expected-warning {{Tainted data is used to specify the buffer size}}
- char *dst = (char*)calloc(ts, sizeof(char)); //expected-warning {{Tainted data is used to specify the buffer size}}
- bcopy(buf1, dst, ts); // expected-warning {{Tainted data is used to specify the buffer size}}
- __builtin_memcpy(dst, buf1, (ts + 4)*sizeof(char)); // expected-warning {{Tainted data is used to specify the buffer size}}
+ int *buf1 = (int*)malloc(ts*sizeof(int)); // expected-warning {{Untrusted data is used to specify the buffer size}}
+ char *dst = (char*)calloc(ts, sizeof(char)); //expected-warning {{Untrusted data is used to specify the buffer size}}
+ bcopy(buf1, dst, ts); // expected-warning {{Untrusted data is used to specify the buffer size}}
+ __builtin_memcpy(dst, buf1, (ts + 4)*sizeof(char)); // expected-warning {{Untrusted data is used to specify the buffer size}}
// If both buffers are trusted, do not issue a warning.
- char *dst2 = (char*)malloc(ts*sizeof(char)); // expected-warning {{Tainted data is used to specify the buffer size}}
+ char *dst2 = (char*)malloc(ts*sizeof(char)); // expected-warning {{Untrusted data is used to specify the buffer size}}
strncat(dst2, dst, ts); // no-warning
}
@@ -164,7 +164,7 @@ void testSocket() {
sock = socket(AF_INET, SOCK_STREAM, 0);
read(sock, buffer, 100);
- execl(buffer, "filename", 0); // expected-warning {{Tainted data passed to a system call}}
+ execl(buffer, "filename", 0); // expected-warning {{Untrusted data is passed to a system call}}
sock = socket(AF_LOCAL, SOCK_STREAM, 0);
read(sock, buffer, 100);