Skip to content

Commit 4dc70fa

Browse files
authored
Merge pull request github#6145 from tamasvajk/feature/stub-jsonnet
C#: Change Newtonsoft.Json stub to nuget-based one
2 parents f6ba4e0 + e200ecd commit 4dc70fa

File tree

5 files changed

+2343
-61
lines changed

5 files changed

+2343
-61
lines changed

csharp/ql/test/library-tests/frameworks/JsonNET/Json.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// semmle-extractor-options: ${testdir}/../../../resources/stubs/JsonNET.cs /r:System.Linq.dll
1+
// semmle-extractor-options: /nostdlib /noconfig --load-sources-from-project:../../../resources/stubs/Newtonsoft.Json/13.0.1/Newtonsoft.Json.csproj
22

33
using Newtonsoft.Json;
44
using Newtonsoft.Json.Linq;
@@ -47,14 +47,14 @@ void F()
4747
Sink((string)jobject["1"]["2"]);
4848

4949
// Linq JToken tests
50-
Sink(jobject.First(i => true));
50+
Sink(jobject.First((JToken i) => true));
5151
Sink(jobject["2"].First(i => true));
5252
Sink(jobject["2"]["3"].First(i => true));
5353
Sink(jobject.SelectToken("Manufacturers[0].Name"));
5454

5555
JObject untaintedJObject = JObject.Parse(u);
5656
Sink(untaintedJObject);
57-
Sink(untaintedJObject.First(i => true));
57+
Sink(untaintedJObject.First((JToken i) => true));
5858
}
5959

6060
public class Object
@@ -64,7 +64,7 @@ public class Object
6464
[JsonIgnore]
6565
public int untainted;
6666

67-
public Dictionary<string,string> taintedValues;
67+
public Dictionary<string, string> taintedValues;
6868

6969
public string[] taintedArray;
7070
}

csharp/ql/test/library-tests/frameworks/JsonNET/Json.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
| Json.cs:18:24:18:32 | "tainted" | Json.cs:45:18:45:29 | access to indexer |
1010
| Json.cs:18:24:18:32 | "tainted" | Json.cs:46:18:46:34 | access to indexer |
1111
| Json.cs:18:24:18:32 | "tainted" | Json.cs:47:18:47:42 | call to operator explicit conversion |
12-
| Json.cs:18:24:18:32 | "tainted" | Json.cs:50:18:50:41 | call to method First |
12+
| Json.cs:18:24:18:32 | "tainted" | Json.cs:50:18:50:50 | call to method First |
1313
| Json.cs:18:24:18:32 | "tainted" | Json.cs:51:18:51:46 | call to method First |
1414
| Json.cs:18:24:18:32 | "tainted" | Json.cs:52:18:52:51 | call to method First |
1515
| Json.cs:18:24:18:32 | "tainted" | Json.cs:53:18:53:61 | call to method SelectToken |

csharp/ql/test/resources/stubs/JsonNET.cs

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)