From f08b439afdde0bc97014fe235d1bc96bbeddd6ef Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Fri, 28 Apr 2023 10:47:26 -0700 Subject: [PATCH] Fix failing test and make predicate private --- .../java/dataflow/ExternalFlowConfiguration.qll | 16 +++------------- .../dataflow/CaptureSinkModels.expected | 2 ++ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/java/ql/lib/semmle/code/java/dataflow/ExternalFlowConfiguration.qll b/java/ql/lib/semmle/code/java/dataflow/ExternalFlowConfiguration.qll index cca6e2f97ad..da7187d723d 100644 --- a/java/ql/lib/semmle/code/java/dataflow/ExternalFlowConfiguration.qll +++ b/java/ql/lib/semmle/code/java/dataflow/ExternalFlowConfiguration.qll @@ -8,7 +8,7 @@ import ExternalFlowExtensions /** * Holds if the specified kind of source model is supported for the current query. */ -extensible predicate supportedThreatModel(string kind); +private extensible predicate supportedThreatModel(string kind); /** * Holds if the specified kind of source model is containted within the specified group. @@ -27,19 +27,9 @@ private string parentThreatModel(string kind) { } /** - * Finds all of the threat models that are children of the specified group. + * Holds if source models of the specified kind are + * supported for the current query. */ -private string childThreatModel(string group) { - threatModelGrouping(result, group) - or exists(string child | childThreatModel(group) = child | - threatModelGrouping(result, child) - ) -} - - /** - * Holds if source models of the specified kind are - * supported for the current query. - */ bindingset[kind] predicate supportedSourceModel(string kind) { // expansive threat model includes all kinds diff --git a/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.expected b/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.expected index b0c363c1b4a..fd30f33065a 100644 --- a/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.expected +++ b/java/ql/test/utils/modelgenerator/dataflow/CaptureSinkModels.expected @@ -1,3 +1,5 @@ +| p;ParamFlow;true;writeChunked;(byte[],OutputStream);;Argument[0];sql;df-generated | +| p;ParamFlow;true;writeChunked;(char[],OutputStream);;Argument[0];sql;df-generated | | p;PrivateFlowViaPublicInterface$SPI;true;openStream;();;Argument[this];create-file;df-generated | | p;Sinks;true;copyFileToDirectory;(Path,Path,CopyOption[]);;Argument[0];read-file;df-generated | | p;Sinks;true;copyFileToDirectory;(Path,Path,CopyOption[]);;Argument[1];create-file;df-generated |