-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
Would it be possible to clean up ContainerFlow.qll by grouping methods in taintPreservingQualifierToMethod and taintPreservingArgumentToQualifier by declaring type, and to include currently missing methods?
The following lists methods for which it would be good if they were covered. For completeness it also lists methods already covered. It is based on JDK 14.
This list currently contains Map and Map.Entry methods which get or set entry keys, however this might not be desired, see also #3869 (comment). These methods are enclosed in square brackets ([...]).
It also cotains toString() of the AbstractX classes, though this might not be desired, see #3894 (comment).
Proposed methods to cover
taintPreservingQualifierToMethod
Maybe in general taint tracking should consider clone() calls in case it does not yet.
-
java.util.Iterableiterator()spliterator()
-
java.util.CollectionparallelStream()stream()toArray()toArray(IntFunction<T[]>)toArray([]T)
Additionally argument should be tainted because, if big enough, elements will be stored in it
-
java.util.AbstractCollectiontoString()
Because it is explicitly specified that the string contains string representations of the elements
-
java.util.Listget(int)listIterator()listIterator(int)remove(int)
Returns old valueset(int, E)
Returns old valuesubList(int, int)
-
java.util.Vector- ?
copyInto(Object[])
Argument should be tainted elementAt(int)elements()firstElement()lastElement()
- ?
-
java.util.Stackpeek()pop()push(E)
Returns the arguments
-
java.util.Queueelement()peek()poll()remove()
-
java.util.DequegetFirst()getLast()peekFirst()peekLast()pollFirst()pollLast()removeFirst()removeLast()
-
java.util.concurrent.BlockingQueue- ?
drainTo(Collection<? super E>)
Argument should be tainted - ?
drainTo(Collection<? super E>, int)
Argument should be tainted poll(long, TimeUnit)take()
- ?
-
java.util.concurrent.BlockingDequepollFirst(long, TimeUnit)pollLast(long, TimeUnit)takeFirst()takeLast()
-
java.util.SortedSetfirst()headSet(E)last()subSet(E, E)tailSet(E)
-
java.util.NavigableSetceiling(E)descendingIterator()descendingSet()floor(E)headSet(E, boolean)higher(E)lower(E)pollFirst()pollLast()subSet(E, boolean, E, boolean)tailSet(E, boolean)
-
java.util.Map.Entry- [
getKey()] getValue()setValue(V)
Returns old value
- [
-
java.util.AbstractMap.SimpleEntrytoString()
Because it is explicitly specified that the string contains string representations of the entry
-
java.util.Mapcompute(K, BiFunction<? super K, ? super V, ? extends V>)
Return value can be based on old valuecomputeIfAbsent(K, Function<? super K, ? extends V>)
Can return old valuecomputeIfPresent(K, BiFunction<? super K, ? super V, ? extends V>)
Return value can be based on old valueentrySet()get(Object)getOrDefault(Object, V)- [
keySet()] merge(K, V, BiFunction<? super V, ? super V, ? extends V>)
Return value can be based on old valueput(K, V)
Returns old valueputIfAbsent(K, V)
Returns old valueremove(Object)
Returns old valuereplace(K, V)
Returns old valuevalues()
-
java.util.AbstractMaptoString()
Because it is explicitly specified that the string contains string representations of the entries
-
java.util.SortedMap- [
firstKey()] headMap(K)- [
lastKey()] subMap(K, K)tailMap(K)
- [
-
java.util.NavigableMapceilingEntry(K)- [
ceilingKey(K)] - [
descendingKeySet()] descendingMap()firstEntry()floorEntry(K)- [
floorKey(K)] headMap(K, boolean)higherEntry(K)- [
higherKey(K)] lastEntry()lowerEntry(K)- [
lowerKey(K)] - [
navigableKeySet()] pollFirstEntry()pollLastEntry()subMap(K, boolean, K, boolean)tailMap(K, boolean)
-
java.util.concurrent.ConcurrentHashMapelements()- [
keys()] - [
keySet(V)] reduce(long, BiFunction<? super K, ? super V, ? extends U>, BiFunction<? super U, ? super U, ? extends U>)reduceEntries(long, BiFunction<Map.Entry<K, V>, Map.Entry<K, V>, ? extends Map.Entry<K, V>>)reduceEntriesToDouble(long, ToDoubleFunction<Map.Entry<K, V>>, double, DoubleBinaryOperator)reduceEntriesToInt(long, ToIntFunction<Map.Entry<K, V>>, int, IntBinaryOperator)reduceEntriesToLong(long, ToLongFunction<Map.Entry<K, V>>, long, LongBinaryOperator)- [
reduceKeys(long, BiFunction<? super K, ? super K, ? extends K>)] - [
reduceKeys(long, Function<? super K, ? extends U>, BiFunction<? super U, ? super U, ? extends U>)] - [
reduceKeysToDouble(long, ToDoubleFunction<? super K>, double, DoubleBinaryOperator)] - [
reduceKeysToInt(long, ToIntFunction<? super K>, int, IntBinaryOperator)] - [
reduceKeysToLong(long, ToLongFunction<? super K>, long, LongBinaryOperator)] - [
reduceToDouble(long, ToDoubleBiFunction<? super K, ? super V>, double, DoubleBinaryOperator)] - [
reduceToInt(long, ToIntBiFunction<? super K, ? super V>, int, IntBinaryOperator)] - [
reduceToLong(long, ToLongBiFunction<? super K, ? super V>, long, LongBinaryOperator)] reduceValues(long, Function<? super V, ? extends U>, BiFunction<? super U, ? super U, ? extends U>)reduceValuesToDouble(long, ToDoubleFunction<? super V>, double, DoubleBinaryOperator)reduceValuesToInt(long, ToIntFunction<? super V>, int, IntBinaryOperator)reduceValuesToLong(long, ToLongFunction<? super V>, long, LongBinaryOperator)search(long, BiFunction<? super K, ? super V, ? extends U>)searchEntries(long, Function<Map.Entry<K, V>, ? extends U>)- [
searchKeys(long, Function<? super K, ? extends U>)] searchValues(long, Function<? super V, ? extends U>)
-
java.util.Dictionaryelements()get(Object)- [
keys()] put(K, V)
Returns old valueremove(Object)
Returns old value
-
java.util.Iteratornext()
-
java.util.ListIteratorprevious()
-
java.util.EnumerationasIterator()nextElement()
taintPreservingArgumentToQualifier
-
java.util.Collectionadd(E)addAll(Collection<? extends E>)
-
java.util.Listadd(int, E)addAll(int, Collection<? extends E>)- ?
replaceAll(UnaryOperator<E>) set(int, E)
-
java.util.VectoraddElement(E)insertElementAt(E, int)setElementAt(E, int)
-
java.util.Stackpush(E)
-
java.util.Queueoffer(E)
-
java.util.DequeaddFirst(E)addLast(E)offerFirst(E)offerLast(E)push(E)
-
java.util.concurrent.BlockingQueueoffer(E, long, TimeUnit)put(E)
-
java.util.concurrent.TransferQueuetransfer(E)tryTransfer(E)tryTransfer(E, long, TimeUnit)
-
java.util.concurrent.BlockingDequeofferFirst(E, long, TimeUnit)offerLast(E, long, TimeUnit)putFirst(E)putLast(E)
-
java.util.Map.EntrysetValue(V)
-
java.util.Map- ?
compute(K, BiFunction<? super K, ? super V, ? extends V>) - ?
computeIfAbsent(K, Function<? super K, ? extends V>) - ?
computeIfPresent(K, BiFunction<? super K, ? super V, ? extends V>) merge(K, V, BiFunction<? super V, ? super V, ? extends V>)put(K, V)putAll(Map<? extends K, ? extends V>)putIfAbsent(K, V)replace(K, V)replace(K, V, V)- ?
replaceAll(BiFunction<? super K, ? super V, ? extends V>)
- ?
-
java.util.Dictionaryput(K, V)
-
java.util.ListIteratoradd(E)set(E)