Skip to content

Commit 5769f47

Browse files
committed
Add missing CollectionUtils model
1 parent 659478c commit 5769f47

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

java/ql/src/semmle/code/java/frameworks/spring/SpringUtil.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ private class FlowSummaries extends SummaryModelCsv {
2626
"org.springframework.util;Base64Utils;false;encodeToUrlSafeString;;;Argument[0];ReturnValue;taint",
2727
"org.springframework.util;Base64Utils;false;encodeUrlSafe;;;Argument[0];ReturnValue;taint",
2828
"org.springframework.util;CollectionUtils;false;arrayToList;;;ArrayElement of Argument[0];Element of ReturnValue;value",
29+
"org.springframework.util;CollectionUtils;false;findFirstMatch;;;Element of Argument[0];ReturnValue;value",
2930
"org.springframework.util;CollectionUtils;false;findValueOfType;;;Element of Argument[0];ReturnValue;value",
3031
"org.springframework.util;CollectionUtils;false;firstElement;;;Element of Argument[0];ReturnValue;value",
3132
"org.springframework.util;CollectionUtils;false;lastElement;;;Element of Argument[0];ReturnValue;value",

java/ql/test/library-tests/frameworks/spring/util/Test.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ public void test() throws Exception {
198198
out = CollectionUtils.arrayToList(in);
199199
sink(getElement(out)); // $hasValueFlow
200200
}
201+
{
202+
// "org.springframework.util;CollectionUtils;false;findFirstMatch;;;Element of Argument[0];ReturnValue;value"
203+
Object out = null;
204+
Collection in = List.of(source());
205+
out = CollectionUtils.findFirstMatch(in, null);
206+
sink(out); // $hasValueFlow
207+
}
201208
{
202209
// "org.springframework.util;CollectionUtils;false;findValueOfType;;;Element of Argument[0];ReturnValue;value"
203210
Object out = null;

0 commit comments

Comments
 (0)