Reviewed By: cristianoc Differential Revision: D3806745 fbshipit-source-id: c73e5cbmaster
parent
91071af3ad
commit
3ff6622c9c
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2015 - present Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
package codetoanalyze.java.quandary;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
|
||||
public class LoggingPrivateData {
|
||||
|
||||
public void logSharedPreferencesDataBad(SharedPreferences prefs) {
|
||||
Log.d("tag", prefs.getString("some", "data"));
|
||||
}
|
||||
|
||||
public void logSharedPreferencesDataInTagBad(SharedPreferences prefs) {
|
||||
Log.d(prefs.getString("some", "data"), "value");
|
||||
}
|
||||
|
||||
public void logDataOk(SharedPreferences prefs) {
|
||||
Log.d("tag", "value");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
# Copyright (c) 2016 - present Facebook, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD style license found in the
|
||||
# LICENSE file in the root directory of this source tree. An additional grant
|
||||
# of patent rights can be found in the PATENTS file in the same directory.
|
||||
|
||||
include ../Makefile
|
||||
|
||||
ANALYZER = quandary
|
||||
INFERPRINT_OPTIONS = --issues-txt
|
||||
|
||||
FILES = \
|
||||
LoggingPrivateData.java \
|
||||
|
||||
compile:
|
||||
javac -cp $(CLASSPATH) $(FILES)
|
||||
|
||||
analyze:
|
||||
$(INFER_BIN) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(FILES) >/dev/null 2>/dev/null
|
@ -0,0 +1,2 @@
|
||||
LoggingPrivateData.java:18: ERROR: QUANDARY_TAINT_ERROR Error: SharedPreferences(String SharedPreferences.getString(String,String) at [line 18]) -> Logging(int Log.d(String,String) at [line 18]) via { }
|
||||
LoggingPrivateData.java:22: ERROR: QUANDARY_TAINT_ERROR Error: SharedPreferences(String SharedPreferences.getString(String,String) at [line 22]) -> Logging(int Log.d(String,String) at [line 22]) via { }
|
Loading…
Reference in new issue