llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.09k stars 11.6k forks source link

Incorrect taint of arrays / pointers #23925

Open llvmbot opened 9 years ago

llvmbot commented 9 years ago
Bugzilla Link 23551
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor

Extended Description

There are problems in GenericTaintChecker.cpp checker:

include

int main() { char buf[256]; scanf("%s", buf); FILE *f = fopen(buf, "r"); // buf is tainted but no warnings generate }

However in other situation checker works properly:

include

int main() { char buf[256]; scanf("%s", buf); FILE f = fopen((char )buf[0], "r"); // Warning: tainted! }

Buuut:

include

int main() { char buf[256]; scanf("%s", buf); FILE f = fopen((char )buf[1], "r"); // Not working again! }

Any ideas, except for taint pointers itself? :)

llvmbot commented 9 years ago

assigned to @tkremenek