FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

使用LinkedHashSet解决有时候无法触发反序列化的问题 · httpsa/JavaThings@b984780 · GitHub

Repository navigation

Commit b984780

Browse files
committed
使用LinkedHashSet解决有时候无法触发反序列化的问题
原因是templates与proxy是有顺序的,如果用HashSet将丢掉顺序,这样有概率无法触发
1 parent 43f4311 commit b984780

2 files changed

Lines changed: 3 additions & 13 deletions

File tree

‎general/pom.xml‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
<properties>
1616
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17-
<maven.compiler.source>1.7</maven.compiler.source>
18-
<maven.compiler.target>1.7</maven.compiler.target>
17+
<maven.compiler.source>1.6</maven.compiler.source>
18+
<maven.compiler.target>1.6</maven.compiler.target>
1919
</properties>
2020

2121
<dependencies>
@@ -96,15 +96,5 @@
9696
</plugin>
9797
</plugins>
9898
</pluginManagement>
99-
<plugins>
100-
<plugin>
101-
<groupId>org.apache.maven.plugins</groupId>
102-
<artifactId>maven-compiler-plugin</artifactId>
103-
<configuration>
104-
<source>7</source>
105-
<target>7</target>
106-
</configuration>
107-
</plugin>
108-
</plugins>
10999
</build>
110100
</project>

‎general/src/main/java/com/govuln/deserialization/JDK7u21.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static void main(String[] args) throws Exception {
4343
Templates proxy = (Templates) Proxy.newProxyInstance(JDK7u21.class.getClassLoader(), new Class[]{Templates.class}, tempHandler);
4444

4545
// 实例化HashSet,并将两个对象放进去
46-
HashSet set = new HashSet(); // maintain order
46+
HashSet set = new LinkedHashSet();
4747
set.add(templates);
4848
set.add(proxy);
4949

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL