GithubHelp home page GithubHelp logo

flankerhqd / type-inference Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 162.4 MB

Automatically exported from code.google.com/p/type-inference

TeX 1.19% HTML 0.71% Shell 0.96% Java 96.50% Makefile 0.29% Python 0.06% PHP 0.01% XSLT 0.01% CSS 0.05% Groff 0.23%

type-inference's People

Stargazers

 avatar Minh-Triet Pham Tran avatar

Watchers

Minh-Triet Pham Tran avatar James Cloos avatar

Forkers

limkokholefork

type-inference's Issues

Androi Apps Results

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


Please use labels and text to provide additional information.


Original issue reported on code.google.com by [email protected] on 13 Sep 2013 at 4:09

Attachments:

Empty method name output for anonymous inner class with non-nullary constructor

What steps will reproduce the problem?
1. Create file a.java with contents
class b  { 
    public b(int x) { }
}

public class a {

    public void m() {
        b ref = new b (42)  {
        };
    }
}
2. Run binary/javai-reim a.java

What is the expected output? What do you see instead?
In infer-output/pure-metods.csv contains:
a$1.(int)
a.m()
b.b(int)

The first line should not be output.

What version of the product are you using? On what operating system?
trunk from svn on Linux (Fedora 19) x64, OpenJDK 1.7.0_51

Please provide any additional information below.
<none>

Original issue reported on code.google.com by [email protected] on 7 Mar 2014 at 7:03

Attachments:

Reim-Infer chokes on static or block initializers

What steps will reproduce the problem?
1. Create a Java file blah.java with the following contents:
public class blah {
  int a;
  {
    a = 1;
  }
}
2. Run binary/javai-reim blah.java

What is the expected output? What do you see instead?
java.lang.Error: Reim processor threw unexpected exception when processing 
blah.java


What version of the product are you using? On what operating system?
trunk from svn. Linux (Fedora 19) OpenJDK 1.7.0_51

Please provide any additional information below.
The reason is in checkers/inference/reim/ReimVisitor.java, checkMutable calls 
TreeUtils.enclosingMethod(getCurrentPath()).
Unfortunately, getCurrentPath() will not contain a METHOD element in case of 
static and non-static block initializers. The nesting will be
EXPRESSION > BLOCK > CLASS.

Original issue reported on code.google.com by [email protected] on 6 Mar 2014 at 10:53

Should not disallow Secret parameter for non-private static methods

==Problem==

In order to have more straightforward type errors, we disallowed SECRET 
parameter for non-private static methods. Suppose we have the following static 
method:

static String escape(String url) {
  // some operations on url
  return url;
}

And we have the following constraint for newUrl1 = StringUtil.escape(oldUrl1):

oldUrl1 <: newUrl1 |> url;

If both oldUrl1 and newUrl are inferred as Secret, then url becomes {Secret, 
Poly}. 

In another statement like newUrl2 = StringUrl.escape(oldUrl2) where oldUrl2 is 
inferred as Secret while newUrl2 as Tainted. Clearly, we have a flow violation, 
but this won't be caught here, because `url` would become {Secret} and this 
above constraint still holds. Eventually, this type error would be caught at 
somewhere, but that is not good. 

Therefore, we disallowed parameters of non-private static method to be Secret. 
However, it leads to another problem when the parameter can be Secret. For 
example, 

public static bool find(String id) {
  @Secret String searchId = ...;
  if (id.equals(searchId) {
    ...
  }
}

Where disallowing `id` to be Secret would lead to an unnecessary type error. 

==Solution==

We should disallow such parameters to be Secret when we solve the constraints. 

Original issue reported on code.google.com by [email protected] on 6 Sep 2013 at 6:59

Bug in special handling of Map structures like hashmap, request

In parameter-httpsplitting configuration, there is a type error 

EQU-271653: JDBCDatabaseExport.java:133(340012):VAR_out{@Poly}  == 
JDBCDatabaseExport.java:139(340043):EXP_out{@Secret}

in snipsnap. 

It was due to the constant "name" used in both JDBCDatabaseExport.java:56:DBSER 
and SnipCopyServlet.java:104:request. It transmitted unnecessary flow. 

Original issue reported on code.google.com by [email protected] on 4 Sep 2013 at 1:25

TODO LIST for Taint Analysis for Andoid Apps By Ana

1. Configure analysis for Android. That is, restrict THIS of
non-private methods of app classes extending/implementing
Android library classes/interfaces, to {POLY,TAINTED}. In other
words, disallow SECRET THIS for those methods. We start with
classes/interfaces Activity, Service, LocationListener and
later add all Android library classes.

This is necessary because of the lack of "main". That is, the
Activity/Service object is created implicitly, not explicitly
and the OS issues callbacks to its methods. Thus, there is
an implicit "x = new XyzActivity()" which amounts to implicit
constraints x <: x |> THIS_m1 and x <: x |> THIS_m2. By setting
the above requirement on THIS_m1 and THIS_m2, we prevent having
one THIS Secret and another THIS Tainted, and thus guarantee that
the above implicit constraints always hold.


2. Bug in dereferencing a Secret Char array. Description below:

The other problem is a new bug I think. They have the following code:
   for(char c : imei.toCharArray()) // imei is a Source, it's                                           Secret
      obfuscated += c + "_";
Here "obfuscated" must become Secret because imei.toCharArray() is Secret.
But for some reason it doesn't.

First I thought the problem was in the "for" construct, but then I tried
   char[] carr = imei.toCharArray();
   char c = carr[0];
   obfuscated = c + "_";
This doesn't work either.

I am almost 100% sure the problem is at "char c = carr[0]". I know that "carr" 
is
inferred as Secret, so it should be some problem with the [] field (maybe we
allow the [] field to be Tainted?).

Original issue reported on code.google.com by [email protected] on 1 Sep 2013 at 9:07

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.