<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Incorrect taint of arrays / pointers"
   href="https://llvm.org/bugs/show_bug.cgi?id=23551">23551</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect taint of arrays / pointers
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>kremenek@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>svadim94@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>There are problems in GenericTaintChecker.cpp checker:

#include <stdio.h>

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 <stdio.h>

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

Buuut:

#include <stdio.h>

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? :)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>